GoSaveTool. Text
(GoSaveTool v1.0.0)
Copy Markdown
Word, character and reading-time counts, social media character limits, case changes, URL slugs and
whitespace cleanup. The Elixir version of @gosavetool/text.
Online counter: https://www.gosavetool.com/character-counter
iex> GoSaveTool.Text.title("the lord of the rings: return of the king")
"The Lord of the Rings: Return of the King"
iex> GoSaveTool.Text.slug("Ölçü Birimi & Çeviri!")
"olcu-birimi-ceviri"Characters are Unicode code points, so an emoji counts as one (not graphemes, as String.length/1 counts).
Summary
Functions
How the text meets each limit: %{"x-post" => %{limit: 280, used: 120, left: 160, fits: true}, ...}.
Pass a list of fields to check only those.
Removes trailing spaces, runs of spaces and more than one blank line in a row.
Character limits of common fields, in display order. SEO values are the length search results show before cutting.
Sentence case.
URL slug, with Turkish and accented letters.
Words, characters, lines, sentences and reading time (238 words a minute) of a text.
Title Case. Short words (a, of, the, and...) stay in lower case unless they start the text or follow a colon.
Words for camelCase and the like.
Functions
How the text meets each limit: %{"x-post" => %{limit: 280, used: 120, left: 160, fits: true}, ...}.
Pass a list of fields to check only those.
Removes trailing spaces, runs of spaces and more than one blank line in a row.
@spec limits() :: [{String.t(), pos_integer()}]
Character limits of common fields, in display order. SEO values are the length search results show before cutting.
Sentence case.
iex> GoSaveTool.Text.sentence("HELLO WORLD. how ARE you?")
"Hello world. How are you?"
URL slug, with Turkish and accented letters.
Words, characters, lines, sentences and reading time (238 words a minute) of a text.
iex> GoSaveTool.Text.stats("Hello world. It’s 2026!")
%{words: 4, chars: 23, chars_no_spaces: 20, lines: 1, sentences: 2, read_seconds: 1}
Title Case. Short words (a, of, the, and...) stay in lower case unless they start the text or follow a colon.
Words for camelCase and the like.
iex> GoSaveTool.Text.words("bestPostingTime 2")
["best", "Posting", "Time", "2"]