Truncate a string with an ellipsis
Shorten text to a maximum length without cutting in the middle of a word or a Unicode character.
Loading snippets…
9 snippets
Shorten text to a maximum length without cutting in the middle of a word or a Unicode character.
Shorten UTF-8 text with mb_ functions so accents and emoji are never cut in half.
Turn text into a lowercase, hyphenated, ASCII-only slug using only the standard library.
Create URL-safe lowercase slugs from titles, removing accents and punctuation.
Convert any title into a lowercase, hyphenated, accent-free slug that is safe to use in a URL.
Uppercase the first letter of a string or of every word, leaving the rest of each word untouched.
Clip long text to one line or N lines with an ellipsis using text-overflow and line-clamp.
Turn a date into a localized relative string using Intl.RelativeTimeFormat, with no library.
Tokenize text and list the most common words using collections.Counter.