-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, 18 Aug 2001 08:18, Jonathan Brannan wrote: > Im reading in a file through a block then a file.each_line {|line| > Then i need to make sure that the \n\r's are striped. At the > moment im doing > line = line.gsub(/[\n\r]/, ""). Was wondering if there was a > better way to do it. Perhaps you would be looking for String#strip! root@eugene:/usr/src/linux# ri String.strip! - ----------------------------------------------------------String#strip! str.strip! -> str or nil - ------------------------------------------------------------------------ Removes leading and trailing whitespace from str. Returns nil if str was not altered. - -- Signed, Holden Glova -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7fb0e+mF116Lw2cQRAnUTAJ9BRQ/ZkguRfISiAr3EhTkF2zup4ACeM6It nNJzeTUlWy7TZp8n/5ZPsbQ= =7Cn5 -----END PGP SIGNATURE-----