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 -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -