Ergo.Utils (Ergo v1.0.4)
Summary
Functions
If the string str
is longer than max
(default: 40) it is truncated to 37 chars and "..." is added to the end, otherwise it is returned unaltered.
Functions
If the string str
is longer than max
(default: 40) it is truncated to 37 chars and "..." is added to the end, otherwise it is returned unaltered.
Examples
iex> Ergo.Utils.ellipsize("frob")
"frob"
iex> Ergo.Utils.ellipsize("123456789012345678901234567890123456789012345678901")
"1234567890123456789012345678901234567..."
iex> Ergo.Utils.ellipsize("12345678901234567890", 10)
"1234567..."
iex> Ergo.Utils.ellipsize("12345", 4)
"1..."