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 -

CSS3 Transition to highlight new elements created in JQuery -