use strict; my $str = "\n Sugarkannan is a smart guy \n"; $str =~ s/^\s*(.*?)\s*$/$1/; print ">$str<\n";
Prints:
>Sugarkannan is a smart guy<
Update: s/printf/print/
In reply to Re: How to eliminate white spaces,tabs,new lines at thestart and end of a long string ??
by GrandFather
in thread How to eliminate white spaces,tabs,new lines at thestart and end of a long string ??
by sugarkannan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |