R
ridcully
Hi,
I want to replace all occurences of a certain character in a string
with a backslash followed by a single quote. Sounds like a trivial
task, but this is what I get:
"this is a test".gsub( "a", "\\'" ) -> "this is test test"
What I want is "this is \' test".
Neither does this work:
"this is a test".gsub( "a", '\' + "'" )
No matter what I am doing, as soon as a backslash is followed by a
single quote in the replacement string, I am getting weird results.
Thanks for your help!
Andreas
I want to replace all occurences of a certain character in a string
with a backslash followed by a single quote. Sounds like a trivial
task, but this is what I get:
"this is a test".gsub( "a", "\\'" ) -> "this is test test"
What I want is "this is \' test".
Neither does this work:
"this is a test".gsub( "a", '\' + "'" )
No matter what I am doing, as soon as a backslash is followed by a
single quote in the replacement string, I am getting weird results.
Thanks for your help!
Andreas