On Mar 1, 2:43 ¨Βν¬ Εςιγ Γθςιστοπθεςσοξ Όεγθςιστοπθες®®®ΐηναιμ®γονwrote: > On Mon, Mar 1, 2010 at 4:10 PM, roger99999 <rscho... / gmail.com> wrote: > > Silly question but I can't seem to find the answer online. I'm > > submitting a search phrase in a scraper and I would like that to be in > > quotation marks. Because the sterm="****" is already in quotation > > marks in the code as: > > > sterm = "United States" > > > , I would have to do ""******"" and that generates an error. How does > > one do this? > > many thanks in advance and apologies for posting such basic questions! > > Roger > > > The error I'm getting is the following. > > > $ ruby article_parse_27feb2010.rb > > article_parse_27feb2010.rb:53: syntax error, unexpected tCONSTANT, > > expecting $end > > ¨Βτεςν ΆΔουβμΕσπςεσσο χιτθ ΧθιππεΓςεανΆ > > There are a few ways you can do it. If your string has double quotes > around it, you escape the embedded double quotes with a backslash, > thus "\"United States\"". > > Or you can enclose your string in single quotes and use the double > quotes as-is (but not that this will not allow you to use #{...} or #$ > or #@ inside the string). > > Finally, you can do as Jesus said, and use %q followed by the string > enclosed in some delimiters like { }, ( ), [ ], etc.; you can actually > even use single non-alphanumeric delimiters like | |, as long as they > match (and aren't used inside the string itself). Jesus and Eric, Perfect - my problem is solved. Many thanks again. Roger