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

On Jan 23, 4:29 pm, Philip Hallstrom <phi...@pjkh.com> wrote:
> > I have string: "xxx | yyy | zzz | ddd"
>
> > I need to split it to: "xxx", "yyy", "zzz" and "ddd",
> > make link to every word like: <a href="xxx">xxx</a>
>
> > So result must by:
>
> > from this:  "xxx | yyy | zzz | ddd"  to this:
>
> > "<a href="xxx">xxx</a>, <a href="yyy">yyy</a>, <a href="zzz">zzz</
> > a>, <a
> > href="ddd">ddd</a>"
>
> > How can I do it?
>
> "xxx | yyy | zzz | ddd".split()....map{}....join()
>
> I'll let you figure out what goes into the () and {}'s :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to