String split help


#1

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:

xxx, yyy, zzz, ddd”

How can I do it?


#2

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 :slight_smile:


#3

“xxx | yyy | zzz | ddd”.split(" | ") # => [“xxx”, “yyy”, “zzz”, “ddd”]