Perl/Shell Knowledge Sharing
Perl Interview Questions and Answers
Wednesday, January 5, 2011
Perl: function to trim string leading and trailing whitespace
use String::Util 'trim';
my $str = " hello ";
$str = trim($str);
print "string is now: '$str'\n";
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment