What the String Utility does
The String Utility applies one text operation at a time: uppercase, lowercase, trim lines, reverse, sort lines, remove duplicate lines, count characters, words and lines, or make a URL slug.
Using the String Utility
- Choose the operation from the dropdown. Changing it re-runs the tool on the same input.
String Utility examples
The built-in sample
Input
say "hello" & <b>bye</b>Output
SAY "HELLO" & <B>BYE</B>This is the input that the Load sample button fills in.
Sort lines
Input
b
A
a
10
9Output
10
9
A
a
bSorting compares character codes: digits come before upper-case letters, which come before lower-case ones, and "10" sorts before "9" because lines are compared as text, not as numbers.
Make URL slug
Input
Crème Brûlée & Co.Output
cr-me-br-l-e-coOnly a to z and 0 to 9 are kept. Accented letters are removed rather than converted, so each one leaves a hyphen behind.
Each output was produced by running this tool on the input above it.
How it works
The selected operation is applied to the whole input. Sort lines, Remove duplicate lines and Trim lines split the text on line breaks; counting splits words on whitespace; Make URL slug lower-cases the text and replaces every run of characters other than a to z and 0 to 9 with one hyphen.
Details and limits
- Reverse text works on whole code points, so an emoji is not broken in two. A character built from several code points, such as a letter with a combining accent or a flag, is still reversed piece by piece.
- Remove duplicate lines keeps the first occurrence and compares lines exactly:
bandbwith a trailing space are different lines. - The character count is the number of UTF-16 code units, the same as a string's
lengthin JavaScript, so most emoji count as two. - Trim lines removes spaces and tabs at both ends of every line but keeps empty lines.
Questions
Is my data uploaded when I use String Utility?
No. The tool runs in your browser, so what you paste or open is processed on your own device and is not sent to a server.
What does String Utility do?
The String Utility applies one text operation at a time: uppercase, lowercase, trim lines, reverse, sort lines, remove duplicate lines, count characters, words and lines, or make a URL slug.
How does String Utility work?
The selected operation is applied to the whole input. Sort lines, Remove duplicate lines and Trim lines split the text on line breaks; counting splits words on whitespace; Make URL slug lower-cases the text and replaces every run of characters other than a to z and 0 to 9 with one hyphen.
Are there any limits I should know about?
Reverse text works on whole code points, so an emoji is not broken in two. A character built from several code points, such as a letter with a combining accent or a flag, is still reversed piece by piece. Remove duplicate lines keeps the first occurrence and compares lines exactly: b and b with a trailing space are different lines.
Is there a size limit?
There is no fixed size limit. Everything happens on your device, so very large inputs depend on its memory and can take longer on a phone than on a computer.
Does it work on phones, and is it free?
Yes. It works in any current browser on Android phones, iPhones, tablets and computers. It is free and needs no account or sign-up.