# `Algo.String`
[🔗](https://github.com/alexkorban/algo/blob/main/lib/algo/string.ex#L1)

Utility functions for strings.

# `humanise`

```elixir
@spec humanise(binary()) :: binary()
```

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("   ")
    ""

# `humanize`

Alias for `humanise/1`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
