Is there a difference? I am new to this.
+4
A:
Jim Hoskins clears it up.
%Q is the equivalent to a double-quoted ruby string. #{expression} evaluation works just like in double-quoted strings, even if you use %Q{} as your delimiter!
You can also leave off the Q and it will have the same functionality. I recommend leaving the Q in to be more clear.
mcandre
2009-08-13 18:42:24
It could be nice if you could post a summary or a quote from the article instead of just giving a link.
musicfreak
2009-08-13 18:44:10
thanks for the link.. a little neat summary of things :)
Xinxua
2009-08-13 18:52:59
Added in the quote that's directly relevant.
Garry Shutler
2009-08-14 07:36:56
+1
A:
There are in effect the same. Both follow double-quoted string semantics
ennuikiller
2009-08-13 18:45:20
+3
A:
No, there is no functional difference. Some might argue that %Q{} is a little clearer, but both are interpolated strings (just like using double quotes).
John Hyland
2009-08-13 18:45:29