Recase.Generic (recase v0.9.1)
View SourceGeneric module to split and join strings back or convert strings to atoms. This module should not be used directly.
Summary
Functions
Splits the input and rejoins it with a separator given. Optionally
converts parts to downcase, upcase or titlecase.
Atomizes a string value. Uses an existing atom if possible.
Splits the input into list. Utility function.
Functions
Splits the input and rejoins it with a separator given. Optionally
converts parts to downcase, upcase or titlecase.
opts[:case] :: [:down | :up | :title | :none]opts[:separator] :: binary() | integer()Default separator is?_, default conversion is:downcaseso that it behaves the same way asto_snake/1.
Examples
iex> Recase.Generic.rejoin "foo_barBaz-λambdaΛambda-привет-Мир", separator: "__"
"foo__bar__baz__λambda__λambda__привет__мир"
Atomizes a string value. Uses an existing atom if possible.
Splits the input into list. Utility function.
Examples
iex> Recase.Generic.split "foo_barBaz-λambdaΛambda-привет-Мир"
["foo", "bar", "Baz", "λambda", "Λambda", "привет", "Мир"]