I have string: “xxx | yyy | zzz | ddd”
I need to split it to: “xxx”, “yyy”, “zzz” and “ddd”,
make link to every word like: xxx
So result must by:
from this: “xxx | yyy | zzz | ddd” to this:
How can I do it?
I have string: “xxx | yyy | zzz | ddd”
I need to split it to: “xxx”, “yyy”, “zzz” and “ddd”,
make link to every word like: xxx
So result must by:
from this: “xxx | yyy | zzz | ddd” to this:
How can I do it?
a>, ddd"
How can I do it?
“xxx | yyy | zzz | ddd”.split()…map{}…join()
I’ll let you figure out what goes into the () and {}'s
“xxx | yyy | zzz | ddd”.split(" | ") # => [“xxx”, “yyy”, “zzz”, “ddd”]
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs