Ruby on Rails Thursday, April 3, 2014

Hi,

I a comma separated string that contains "comma separated substrings"
like this:

str= ' "hello ,there" ,how,are ,you, "I am , fine" '

every substring that contains comma is in a " ".

I am trying to split str based on, so I should get something like:

"hello ,there"
how
are
you
"I am , fine"

tried many things like "split", ... didn't work.

any idea how to do this.

Thank you

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2ff0c38ffc3ed77d1a7534d6f8442739%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment