Compare length of two strings: Difference between revisions

(Added AutoHotkey)
Line 470:
"shorter😀" has length (codepoints) 8 and utf8 byte length 11.
"longer" has length (codepoints) 6 and utf8 byte length 6.
</pre>
=={{header|Mathematica}} / {{header|Wolfram Language}}==
<lang Mathematica>list = {"abcd", "123456789", "abcdef", "1234567"};
Reverse@SortBy[list, StringLength] // TableForm</lang>
 
{{out}}<pre>
123456789
1234567
abcdef
abcd
</pre>
 
Anonymous user