From: Ashikali Ashikali Date: 2009-02-19T23:59:57+09:00 Subject: Re: Replacing values Andrew Timberlake wrote: > On Thu, Feb 19, 2009 at 3:41 PM, Ashikali Ashikali > wrote: > >> "This is 18" >> >> Question , >> How can I convert '' value to "" value . >> -- >> Posted via http://www.ruby-forum.com/. >> > > Your question is not clear > > Changing a ' to a " is as simple as typing a different character. > In your example you are typing a string literal so typing it differently > should get you the results you're looking for. > > If you're working on another string, you can do: .gsub(/'/, '"') > > Andrew Timberlake > http://ramblingsonrails.com > http://www.linkedin.com/in/andrewtimberlake > > "I have never let my schooling interfere with my education" - Mark Twain my question is not that converting ' to " . Apart from this , when we declare string as "" , our ruby replace the variable value into actual value like this , c = 10 b = "This is #{c}" puts b #it prints "This is 10" In above, it start to execute and replace c variable value so it prints , "This is 10" . m = 'This is #{d}' #single quote In above , it does not replace d variable( not yet created ) . d = 15 #if I do puts m 'This is #{d}' What I want is when we converting ' to " it start to replace the value d . is there any method available to do this . -- Posted via http://www.ruby-forum.com/.