recase v0.6.0 Recase View Source
Recase allows you to convert string from any to any case.
This module contains public interface.
Link to this section Summary
Functions
Converts string to camelCase.
Converts string to CONSTANT_CASE.
Converts string to dot.case
Converts string to kebab-case.
Converts string to PascalCase (aka UpperCase).
Converts string to path/case.
Converts string to Sentence case
Converts string to snake_case.
Converts string to Title Case
Link to this section Functions
Link to this function
to_camel(value) View Source
Converts string to camelCase.
Examples
iex> Recase.to_camel("some-value")
"someValue"
iex> Recase.to_camel("Some Value")
"someValue"
Link to this function
to_constant(value) View Source
Converts string to CONSTANT_CASE.
Examples
iex> Recase.to_constant("SomeValue")
"SOME_VALUE"
iex> Recase.to_constant("some value")
"SOME_VALUE"
Link to this function
to_dot(value) View Source
Converts string to dot.case
Examples
iex> Recase.to_dot("SomeValue")
"some.value"
iex> Recase.to_dot("some value")
"some.value"
Link to this function
to_kebab(value) View Source
Converts string to kebab-case.
Examples
iex> Recase.to_kebab("SomeValue")
"some-value"
iex> Recase.to_kebab("some value")
"some-value"
Link to this function
to_pascal(value) View Source
Converts string to PascalCase (aka UpperCase).
Examples
iex> Recase.to_pascal("some-value")
"SomeValue"
iex> Recase.to_pascal("some value")
"SomeValue"
Link to this function
to_path(value) View Source
Link to this function
to_path(value, separator) View Source
Converts string to path/case.
Examples
iex> Recase.to_path("SomeValue")
"Some/Value"
iex> Recase.to_path("some value", "\\")
"some\\value"
Link to this function
to_sentence(value) View Source
Converts string to Sentence case
Examples
iex> Recase.to_sentence("SomeValue")
"Some value"
iex> Recase.to_sentence("some value")
"Some value"
Link to this function
to_snake(value) View Source
Converts string to snake_case.
Examples
iex> Recase.to_snake("some-value")
"some_value"
iex> Recase.to_snake("someValue")
"some_value"
Link to this function
to_title(value) View Source
Converts string to Title Case
Examples
iex> Recase.to_title("SomeValue")
"Some Value"
iex> Recase.to_title("some value")
"Some Value"
Link to this function
underscore(value) View Source
See Recase.to_snake/1
.