Topic: quoted string problem

I want to cast the quoted string  "content" to 'content'  (with single quotation marks)
(The html code wich demand a url doesn't accept quotation marks - and when I try eval this causes an error)

How can I do that?

Last edited by Percy2000 (2010-03-25 04:52:50)

Re: quoted string problem

Percy2000 wrote:

I want to cast the quoted string  "content" to 'content'  (with single quotation marks)
(The html code wich demand a url doesn't accept quotation marks - and when I try eval this causes an error)

How can I do that?

>> string = "\"content\""
=> ""content""
>> string.gsub("\"","'")
=> "'content'"

I'm not sure if i understood your question, if not then an example would help.

###########################################
#If i've helped you then please recommend me at Working With Rails:
#http://www.workingwithrails.com/person/ … i-williams