I mean a string is blank if it's empty or contains whitespaces only.
For example, ""
, " "
and "\n"
are all blank.
In Rails, we have the .blank?
method.
Is there something similar in Elixir (or in the Phoenix Framework)?
String.trim/1 seems to do the trick as of Elixir 1.3.0.
strip
still works, but it was soft deprecated in the 1.3.0 release and it isn't listed in the String docs.