That is what you want to use.

You could do it in a single regex:
## NOT RECOMMENDED - SEE NOTE BELOW ##
$username =~ s/^\s+|\s+$//g;

The downside is that this is not efficient and actually takes Perl longer to
perform the operation.  If you want to know why you need to know a little
about how Perl stores strings internally.

Rob

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, September 29, 2003 8:04 PM
To: [EMAIL PROTECTED]
Subject: remove blanks


Is there a func or a onliner for removing blanks from both ends?

I'm using these:

$username =~ s/^\s+//;
$username =~ s/\s+$//;

There got to be one out there!

thanks,
-rkl

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to