D
Deepu Damodaran
Hi all,
I'm very new to Ruby. My problem is simply to search for '\' character
from a string. The string is the windows file path. I have to either
escape the '\' character or substitute it with '/'. But String::include?
methods doesn't seems to be helpful. Please see the log.
irb(main):004:0> fold = "abcdefgh/ajf;ldsj\dfd"
=> "abcdefgh/ajf;ldsjdfd"
irb(main):005:0> puts fold.include?("\\")
false
=> nil
irb(main):006:0> puts fold.include?("\")
irb(main):007:1"
so how can we search for the '\' using .include?
Thanks and Regards,
Deepu D
I'm very new to Ruby. My problem is simply to search for '\' character
from a string. The string is the windows file path. I have to either
escape the '\' character or substitute it with '/'. But String::include?
methods doesn't seems to be helpful. Please see the log.
irb(main):004:0> fold = "abcdefgh/ajf;ldsj\dfd"
=> "abcdefgh/ajf;ldsjdfd"
irb(main):005:0> puts fold.include?("\\")
false
=> nil
irb(main):006:0> puts fold.include?("\")
irb(main):007:1"
so how can we search for the '\' using .include?
Thanks and Regards,
Deepu D