Lloyd Linklater wrote:
> Rafael Viana wrote:
>> Is it possible to have a string with a single backslash?
>> 
> 
> Indeed.
> 
> s = "\foo"
> p s
> 
> => "\foo"



Hi, I'm very sorry for my bad example. This problem only occurs when I 
need the values "\d" and "\l" on the strings. I need to be able to 
compare this value to see if a string has it. (e.g.: if var = "\d" do 
this...)

When I do something like:

 var = "\d"
 I get
 "d"

 But when I do:

 var = "\\d"
 I get
 "\\d"

 And when I do:

 var = '\d'
 I get
 "\\d"

Again, sorry for my bad example. I hope there's a solution for this.
-- 
Posted via http://www.ruby-forum.com/.