I have some odd characters appearing in lines that break the script. From what I can say put badstring for the console, they are "\0\0\0\0" .
I would like to test this so that I can ignore them ... but how?
thought for <? 22> and empty? for?!?
> badstring = "\0" => "\u0000" > badstring.blank? NoMethodError: undefined method `blank?' for "\u0000":String from (irb):97 from /Users/meltemi/.rvm/rubies/ruby-2.0.0-p195/bin/irb:16:in `<main>' > badstring.empty? => false > badstring.nil? => false
Edit: trying to recreate this in irb, but with problems:
> test1 = "\0\0\0\0" => "\u0000\u0000\u0000\u0000" > test2 = '\0\0\0\0' => "\\0\\0\\0\\0"
what I want is the string "\0\0\0\0" , so I can find a way to test if mystring == "\0\0\0\0" or something like that.
source share