Utility functions for strings.
Summary
Functions
Convert an underscored, camelised, or dasherised string into one that can be read by humans. Also remove beginning and ending whitespace, and removes the postfix '_id'. The first character will be capitalised. For underscored strings, replaces underscores with spaces. For dasherised strings, replaces dashes with spaces. For camelised strings, inserts a space before any occurrence of an uppercase letter that is preceded by a lowercase letter. For identifier-like strings like 'author_id', removes the postfix '_id' and replaces underscores with spaces.
Alias for humanise/1.
Functions
Convert an underscored, camelised, or dasherised string into one that can be read by humans. Also remove beginning and ending whitespace, and removes the postfix '_id'. The first character will be capitalised. For underscored strings, replaces underscores with spaces. For dasherised strings, replaces dashes with spaces. For camelised strings, inserts a space before any occurrence of an uppercase letter that is preceded by a lowercase letter. For identifier-like strings like 'author_id', removes the postfix '_id' and replaces underscores with spaces.
Examples
iex> Algo.String.humanise("author_id")
"Author"
iex> Algo.String.humanise(" thisIsDDOSAttack ")
"This is DDOS attack"
iex> Algo.String.humanise("")
""
iex> Algo.String.humanise(" ")
""
Alias for humanise/1.