Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: TRIM in Perl?

by charnos (Friar)
on Sep 10, 2002 at 16:31 UTC ( [id://196738]=note: print w/replies, xml ) Need Help??


in reply to TRIM in Perl?

Since with all the suggestions here we're just eliminating all spaces in the string, wouldn't simple transliteration ($temp =~ tr/ //d;) be faster/simpler?

Update: EEK! *bangs head* Nevermind, I retract that, $temp =~ s/^\s+|\s$/ would be the best way to do it.

Replies are listed 'Best First'.
Re^2: TRIM in Perl?
by Aristotle (Chancellor) on Sep 10, 2002 at 16:45 UTC
    Where did you see "all suggestions [..] just eliminating all spaces"? None of them do.

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://196738]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-24 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found