M
Micke Micke
Hi all
I'm trying to build a new string from a existing one.
The original string is: my frog name is froggy
I will pull out only: frog froggy
I have tried the following:
----
str1 = 'my frog name is froggy'
str2 = str1[/frog|froggy/]
puts str2
---
This will print only the string: frog
I can get the information with this code:
----
str1 = 'my frog name is froggy'
str2 = str1[/frog] + " " + str1[/froggy/]
puts str2
----
This will print the string: frog froggy
But i think it is possible to solve this in a better way, Any
suggestions ?
// Micke
I'm trying to build a new string from a existing one.
The original string is: my frog name is froggy
I will pull out only: frog froggy
I have tried the following:
----
str1 = 'my frog name is froggy'
str2 = str1[/frog|froggy/]
puts str2
---
This will print only the string: frog
I can get the information with this code:
----
str1 = 'my frog name is froggy'
str2 = str1[/frog] + " " + str1[/froggy/]
puts str2
----
This will print the string: frog froggy
But i think it is possible to solve this in a better way, Any
suggestions ?
// Micke