J
J-H Johansen
Hi,
I'm somewhat stumped at the moment due to problems with inserting
strings in postgresql containing 's.
Normally, I'd just add a \ to escape the ' and everything would be just fine.
But for some reason, Ruby won't let me do this.
ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-linux]
irb(main):033:0* s = "blah'blah"
=> "blah'blah"
irb(main):034:0> s.gsub(/'/, "\\'")
=> "blahblahblah"
irb(main):035:0> s.gsub("'", "\\'")
=> "blahblahblah"
I've seen myself blind on this one ...and I still can't see where the
problem is. Any clues ?
I'm somewhat stumped at the moment due to problems with inserting
strings in postgresql containing 's.
Normally, I'd just add a \ to escape the ' and everything would be just fine.
But for some reason, Ruby won't let me do this.
ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-linux]
irb(main):033:0* s = "blah'blah"
=> "blah'blah"
irb(main):034:0> s.gsub(/'/, "\\'")
=> "blahblahblah"
irb(main):035:0> s.gsub("'", "\\'")
=> "blahblahblah"
I've seen myself blind on this one ...and I still can't see where the
problem is. Any clues ?