array sorts @ after numbers

howdy all,
now i have been mucking around with an array. example of one with values would be ("#",“1”,“22”,"@",“d”,"/") and so on. all random values
now i have noticed symbols like !,#,& will get sorted before numbers, but the @ will get sorted after numbers. This is sorting a string array
anyone else found this issue? i would assume all weird symbols, characters would go first, then numbers, then letters, but it seems to get mixed up a bit.

sorting is lexical based on UTF8 character tables which, for any character whose code point is < 127 follows ASCII
so it will sort in the order of the ascii table
http://www.asciitable.com

And you would be wrong. If you look at the table that Norman referenced, you will see that the numbers fall right in the middle of the “weird characters”. Namely,

!"#$%&'()*=,-./0123456789:;<=>?@

Another sorting “gotcha” is representing numbers as strings…

Strings sorting works like Norman mentioned above…

So if you had and array like (“1”,“2”,“3”,“20”,“30”,“100”)
if would sort as

“1”,“100”,“2”,“20”,“3”,“30”

which is 100% legit… not a bug… it is what should happen.