Using String.trim to trim whitespace from strings:

iex> String.trim("   abc  ")
"abc"