Recase.Generic (recase v0.7.0) View Source
Generic module to split and join strings back or convert strings to atoms. This module should not be used directly.
Link to this section 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.
Link to this section Functions
Specs
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:downcase
so that it behaves the same way asto_snake/1
.Examples
iex> Recase.Generic.rejoin "foobarBaz-λambdaΛambda-привет-Мир", separator: "_" "foobarbazλambdaλambdaприветмир"
Specs
Atomizes a string value. Uses an existing atom if possible.
Specs
Splits the input into list
. Utility function.
Examples
iex> Recase.Generic.split "foo_barBaz-λambdaΛambda-привет-Мир"
["foo", "bar", "Baz", "λambda", "Λambda", "привет", "Мир"]