Morton Goldberg
7/6/2007 6:54:00 PM
On Jul 6, 2007, at 11:42 AM, Ari Brown wrote:
>
> On Jul 5, 2007, at 11:27 PM, Morton Goldberg wrote:
> <snip>
>>
>> Others have pointed out a problem with your case statement, but I
>> think there's another problem here -- your #{$1} substitution
>> isn't going to work in single-quoted string.
>
> You're serious? I can't use variable substitution in a single
> quoted string? I ran into that a while ago, but i just thought it
> was some glitch on my part!
Dead serious. However, the following may suggest a solution to you:
foo = 42
puts %["#{foo}"]
> Why is that so?
I suspect it's to allow us to print strings verbatim.
> Whats the difference between single and double quoted strings?
I believe single-quoted strings have only one special character --
the single quote.
Regards, Morton