From: Milo Luo Date: 2009-12-27T18:31:40+09:00 Subject: Re: How to truncate the spaces in the front of a line Fleck Jean-Julien wrote: > Hello, > >> so strange... >> /s should match all the spaces, including tabs,but it doesn't work. >> I will try to use XML Parser. > > Well, it would be more useful if you used \s instead (wih a backslash > and not a slash). Try with > > name = line.gsub(/^\s+/,"") > > By the way, all useful shortcuts in regexp start with a backslash and > not a slash (usually reserved to delimit the regexp) > > Cheers, Oh, I used the wrong syntax and it works now. Thank you, Fleck. :) Milo -- Posted via http://www.ruby-forum.com/.