String split help

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?

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:

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