Perl: the Markov chain saw | |
PerlMonks |
Re: what is the function should I need to use for trim white spaces ?by davido (Cardinal) |
on Jan 11, 2006 at 19:17 UTC ( [id://522534]=note: print w/replies, xml ) | Need Help?? |
There's not a built-in. The regexp approach is fine. If you want it to be a sub, just put it in a sub definition:
Update: For completeness's sake, it might be worth noting that on CPAN you can find String::Util, which includes a function called trim() that does exactly what you're talking about. ...it's been done. ;) Dave
In Section
Seekers of Perl Wisdom
|
|