From: "Michael T. Richter" Date: 2008-07-18T14:21:31+09:00 Subject: Re: generating webpages with Ruby... help with double quotes --=-cSXm5fcFlzneB6nP0Wer Content-Type: text/plain Content-Transfer-Encoding: 7bit On Fri, 2008-07-18 at 12:09 +0900, Zoe Phoenix wrote: > I want a program that I'm working on to generate some web pages for me, > but I'm having trouble with generating the pages in HTML, since it uses > the double quotes for links, as in href="http://www.blahblahblah.com">. > Since there are a lot of the links in this page, I need to know what the > best way to get around this problem is. Can someone help me, please? Strings have a large number of different representations for precisely this reason: "" # double-quoted strings do interpolation and have a lot of \-escapes. '' # single-quoted strings don't do interpolation and only \-escape \ and '. %q{} # same as a single-quoted string, but ' isn't special %q|| # the delimiter doesn't have to be braces %Q{} # same as double-quoted-string, but " isn't special Then there's "here documents" and the like, and there's other variants of these in the facets gem. Pick and choose the representation that suits your needs best. (In your case I'd likely recommend %Q{string here}, %Q(string here) or even %Q|string here|.) -- Michael T. Richter (GoogleTalk: ttmrichter@gmail.com) If there's one thing that computers do well, it's to make the same mistake uncountable times at inhuman speed. (Peter Coffee) --=-cSXm5fcFlzneB6nP0Wer--