ruby - How can I extract part of a string that is in quotes -


say have string:

foo = "this string 'with string inside it!'" 

how extract 'with string inside it!' foo?

foo = "this string 'with string inside it!'" foo[foo.index("'")..foo.rindex("'")] #=> "'with string inside it!'" 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -