I have a function where one of its arguments is a string. How would I check the string for leading and trailing whitespaces and remove those characters?
If i get something like this:
" " => ""
" foo" => "foo"
"foo " => "foo"
In PHP I can use the method
trim and it returns the string with whitespaces stripped from the beginning and end.
I did not find any solution on StackExchange.
How do I do a