From: David Springer on 31 Mar 2010 19:52 > s.gsub!(/#(\d+);/, "\134\134#{conv_char($)}") I meant: s.gsub!(/#(\d+);/, "\134\134#{conv_char($1)}") I'm having trouble doing copy & paste from irb under windows. David -- Posted via http://www.ruby-forum.com/.
From: Max Schmidt on 31 Mar 2010 19:13 >s.gsub!(/#(\d+);/) { '\'+$1.to_i.to_s(8)} >is giving some compile error. You have to escape the slash (\) like this >s.gsub!(/#(\d+);/) { '\\'+$1.to_i.to_s(8)} -- Posted via http://www.ruby-forum.com/.
First
|
Prev
|
Pages: 1 2 Prev: stetecting change in number of leading spaces while looping Next: socket programming...lsof? |