I have a string that looks like this...
"
http://www.example.com/example.pdf"
I need to remove the whitespaces and linebreaks. How do I do this? My result should be
"http://www.example.com/example.pdf"
Just use the s///
substitution operator:
$string =~ s/\s+//g;
The \s
character class matches a whitespace character, the set [\ \t\r\n\f]
and others.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With