I have the following string &firstname.lastname@example.org; email@example.com; firstname.lastname@example.org; email@example.com; firstname.lastname@example.org; email@example.com;
Local array of string &array_string = Split(&mystring, ";");
it become firstname.lastname@example.org-> email@example.com-> firstname.lastname@example.org->email@example.com->firstname.lastname@example.org->email@example.com why not firstname.lastname@example.org-> email@example.com-> firstname.lastname@example.org->email@example.com->firstname.lastname@example.org->email@example.com
you are sorting an array of strings. Therefore, the sort will be done based on the ASCII character code. Alpha and numeric characters are handled in the same way. The ascii character code for 1 = 49 and for 8 = 56.
So, in your example firstname.lastname@example.org->email@example.com becuase the number 49 naturally comes before 56. in sorting strings no differentiation is made between alpha and numeric characters.
imagine you were sorting the following strings. What would you want the sort behaviour to be? Logically an ascii based sort would produce a sort order that may not match what a human might illogically want.
To my knowledge... there is no way to control the behaviour of this kind of sorting in PeopleTools.
There may be a way to break out of PeopleCode and do a sort in Java. http://stackoverflow.com/questions/104599/sort-on-a-string-that-may-contain-a-number
Thanks for the reply,
I just may sure there is not space between my sorting string to deal with the problem. my questions is why??
in ASCII space is 32 letter is 65 to 90 and 97 to 122, how come the space can cause the sorting problem???