Ergo.Utils (Ergo v0.9.9)
Link to this section 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.
Link to this section Functions
Link to this function
ellipsize(str, max \\ 40)
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..."
Link to this function
format_tracks(tracks)
Link to this function
printable_string(s)
Link to this function