From: Peter Tosh Date: 2009-06-13T03:35:43+09:00 Subject: Re: Remove double backslash in string "c:\\test" Justin Collins wrote: > Peter Tosh wrote: >> >> thanks! >> Niels >> > Are you sure there are two backslashes, or is that just the escaping > backslash? > > irb(main):001:0> "c:\\test" > => "c:\\test" > irb(main):002:0> puts "c:\\test" > c:\test > => nil > irb(main):003:0> "c:\\test".length > => 7 > > > -Justin Thanks Justin, when I print out the length it comes to 7 => it is just the escaping backslash. But in my program I need to compare it to a string from the database: "c:\test". When Ruby internally stores it as "c:\\test", how do I compare the two? When use the debugger it looks like this: (rdb:1) pp @path "c:\\Test" (rdb:1) pp @path.length 7 Niels -- Posted via http://www.ruby-forum.com/.