Top 500 unique perl programming interview questions and answers to master in perl regular expression programs - part1
- How can I remove leading and trailing white spaces from a string in Perl?
Read more »perl1$str = " Hello World! "; 2$str =~ s/^\s+|\s+$//g; 3print $str; # Output: "Hello World!"