Rafael Viana wrote:
> Is it possible to have a string with a single backslash?
> 
> I want var to have the value "\foo"
> 
> And when I do something like:
> 
> var = "\foo"
> I get
> "foo"
> 
> But when I do:
> 
> var = "\\foo"
> I get
> "\\foo"
> 
> And when I do:
> 
> var = '\foo'
> I get
> "\\foo"
> 
> I even tried to remove one of the backslashes from the "\\foo" string,
> but then I just get "foo" :-(
> 
> 
> Thanks for reading, and I hope you can help me out




use double quotes don't use single quotes man
like var="\foo"

var="\\foo"
u will get
"\\foo"

var = "\foo"
u will get
"\foo"
-- 
Posted via http://www.ruby-forum.com/.