Script -  to remove leading and trailing spaces from the passed string
--------------------------------------------------------------------------------------------------
#/usr/bin/perl
my $string  = <>;
@temp = split / / , $string;
$string =~ s/^\s+//; #remove leading spaces
$string =~ s/\s+$//; #remove trailing spaces
print @temp
--------------------------------------------------------------------------------------------------
 
No comments:
Post a Comment