Sort Text Online
All processing happens on the client-side, locally in your browser. No data is uploaded.
Settings
How the input is converted. Each is explained below.
History
- 2018-11-12Multiple separator support
- 2017-09-07Tool Launched
Settings explained
- Sort Type
This is the main setting as it governs the sorting logic/strategy. The following strategies are available:-
Alphabetical: This is the default sorting order which utilizes a case insensitive & culture neutral comparison between items. Numbers are treated as normal ASCII characters.
Alphabetical007, James Bond 09, John Doe 1, Jane Doe
Natural: This is similar to alphabetical sorting, but treats numbers differently. Consecutive numbers are grouped together and treated as a single character. For example, "1, Jane Doe" will appear before "007, James Bond".
Natural1, Jane Doe 007, James Bond 09, John Doe
Length: Lines are sorted on the basis of their lengths in characters. The smaller ones bubble to the top, or, with the descending sort order, sink to the bottom.
Length1, Jane Doe 09, John Doe 007, James Bond
Reverse: Reverses the order of the lines in the original input. Sort Order is not supported in this mode.
Random: Shuffles the lines into a random order. Sort Order is not supported in this mode.
- Input & Output Separator
The separator for the input text that determines each item in the list, and the one the output is written with.
- New Line
- Each item is separated by a newline (\r, \n or \r\n)
- Comma
- Each item is separated by comma (,)
- Semi Colon
- Each item is separated by semi-colon (;)
- Tab
- Each item is separated by tab (\t)
- Auto
- Input: separators are automatically detected from the input. Output: the same as the input separator.
Background
How to sort text in various languages
| Language | Sort Function | Documentation | Example |
|---|---|---|---|
| C# | System.Collections.Generic.List<T>.Sort() | Documentation | Example |
| VB .NET | System.Collections.Generic.List<T>.Sort() | Documentation | Example |
| Java | java.util.Collections.sort() | Documentation | Example |
| JavaScript | sort() | Example | |
| Python | list.sort() | Documentation | Example |
| Ruby | Array.sort() | Documentation | Example |