From: sto.mar@... Date: 2013-02-22T15:50:22+09:00 Subject: Re: backslash substitution Am 21.02.2013 11:26, schrieb Mario Ruiz: > don't know why... but this is not working > a=" xxxxxx\tttt\3.4.2\uuuu" > puts a.gsub('\\','/') > > And the result is: > xxxxxx ttt.4.2uuuu > > what i want is xxxxxxx/tttt/3.4.2/uuuu Your example string does not contain any backslashes! Instead it contains for example a tab: [1] pry(main)> puts "a\tb" a b You need to define the string using single quotes: [2] pry(main)> puts 'a\tb' a\tb Backslashes are interpreted differently in String literals with single and double quotes. --