At 12:45 +0100 3/3/09, Manfred Stienstra wrote: > On Mar 3, 2009, at 12:37 PM, Robert Schaaf wrote: >> string.unpack('U*'). >> select { |c| (0x20..0x7e).include? (c) }. >> pack('U*')
It looks to me like this is a solution for a different problem; that is, discarding characters outside of the specified range. Also, do we want to map newlines, etc? Anyway, irb sez: >> a = "abc\x0adef" => "abc\ndef" >> a.gsub(/[^\x20-\x7e]/, ' ') => "abc def" >> a.gsub(/[^\x00-\x7e]/, ' ') => "abc\ndef" -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume r...@cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel