Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
sort order for strings of digits
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="DJC, post: 5058495"] Sorry for the confusion, the pair of strings was just a way of testing variations on the input. So a sequence with any combination of strings that can be read as numbers and strings of chars that don't look like numbers (even if that string includes digits) is the expected input Not quite, what I want is to ensure that if the strings look like numbers they are placed in numerical order. ie 1 2 3 10 100 not 1 10 100 2 3. Cases where a string has some leading digits can be treated as strings like any other. Well it depends on the use case. In my case the strings are column and row labels for a report. I want them to be presented in a convenient to read sequence. Which the lexical sorting of the strings that look like numbers is not. I want a reasonable do-what-i-mean default sort order that can handle whatever strings are used. That looks more than general enough for my purposes! I will experiment along those lines, thank you. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
sort order for strings of digits
Top