From: Alex Gutteridge Date: 2013-02-22T18:37:39+09:00 Subject: Re: backslash substitution On 22.02.2013 09:27, Mario Ruiz wrote: > I found this solution... but i thought that Ruby had a better way: > > > x="xxxxx P jjjjjj\0\1\2\3.4.1\4\5\6\7\8\9" > m="" > x.each_byte {|a| > puts a > if a<32 then > m+="/" + a.to_s() > else > m+=a.chr > end > } > puts m Has that really done what you want though? >> puts m xxxxx P jjjjjj/0/1/2/3.4.1/4/5/6/789 -- Alex Gutteridge