Anonymous user
Natural sorting: Difference between revisions
m
(Less spaced out but following earlier tidying-up)
m (aligned the "replacement---as" letters.) |
m ((Less spaced out but following earlier tidying-up)) |
||
Line 38:
;Sample input:
<pre>
# Ignoring leading spaces.
Text strings:
'ignore leading spaces: 2+0',
'ignore leading spaces: 2+1']
# Ignoring multiple adjacent spaces (m.a.s).
Text strings:
'ignore m.a.s spaces: 2+0',
'ignore m.a.s spaces: 2+1']
# Equivalent whitespace characters.
Text strings:
['Equiv. spaces: 3-3',
'Equiv. \nspaces: 3+1',
'Equiv. \tspaces: 3+2']
# Case Independent sort.
Text strings:
'casE INDEPENDENT: 3+0',
'case INDEPENDENT: 3+1']
# Numeric fields as numerics.
Text strings:
['foo100bar99baz0.txt',
'foo100bar10baz0.txt',
'foo1000bar99baz10.txt',
'foo1000bar99baz9.txt']
# Title sorts.
# Equivalent accented characters (and case). Text strings: [u'Equiv. \xfd accents: 2-2', ▼
Text strings:
['The Wind in the Willows',
'The 40th step more',
'The 39 steps',
'Wanda']
Text strings:
[u'Equiv. \xfd accents: 2-2',
u'Equiv. \xdd accents: 2-1',
u'Equiv. y accents: 2+0',
u'Equiv. Y accents: 2+1']
# Separated ligatures.
Text strings:
[u'\u0132 ligatured ij',
'no ligature']
</pre><br><br>▼
# Character replacements.
Text strings:
[u'Start with an \u0292: 2-2',
u'Start with an \u017f: 2-1',
u'Start with an \xdf: 2+0',
u'Start with an s: 2+1']
▲</pre><br><br>
=={{header|AppleScript}}==
|