Is there an Java like trim function for Perl.
I am looking for function in Perl that removes all the leading and trailing characters below 0x20, like in Java.
After calling the function on the following string.
my $string = "\N{U+0020}\N{U+001f}\N{U+001e}\N{U+001d}\N{U+001c}\N{U+001b}\N{U+001a}\N{U+0019}\N{U+0018}\N{U+0017}\N{U+0016}\N{U+0015}\N{U+0014}\N{U+0013}\N{U+0012}\N{U+0011}Hello Moto\N{U+0010}\N{U+000f}\N{U+000e}\N{U+000d}\N{U+000c}\N{U+000b}\N{U+000a}\N{U+0009}\N{U+0008}\N{U+0007}\N{U+0006}\N{U+0005}\N{U+0004}\N{U+0003}\N{U+0002}\N{U+0001}\N{U+0000}";
Only "Hello Moto" should be left.
The trim from String::Util only removes the first whitespace (\N{U+0020}).