What about this it worked for me:
'<?xml version="1.0" encoding="UTF-8"...' + "#{a}" + '...>'
--Mark
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris McMahon
Sent: Wednesday, September 28, 2005 2:55 PM
To: [email protected]
Subject: [Wtr-general] OT: double-quotes and substitution in same
string?
Hi...
Sorry for the OT post, but this is driving me crazy...
I have an XML string that needs double-quotes, so to turn it into a
string, I enclose in single quotes. It looks a little like this:
'<?xml version="1.0" encoding="UTF-8"...>'
But I also need to substitute a variable into the string with #{}, like
so:
a = 123
'<?xml version="1.0" encoding="UTF-8"...#{a}...>'
but #{} doesn't work inside of single-quoted strings, and
double-quotes inside of double-quotes are illegal, and slashes also
don't work, i.e
a = 123
/<?xml version="1.0" encoding="UTF-8"...#{a}...>/
Any suggestions to substitute a string and use double-quotes
simultaneously in a single string? I'm sure it's possible, I just
can't figure out how....
-Chris
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general