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:
" " => ""
or
" foo" => "foo"
or
"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 trim in solidity?