Sort Tarray of FStrings Alphanumericaly
I have a TArray of FStrings that I would like to sort Alphanumerically. And I know TArray has a sort function which relies on predicates which Im not really familiar with. How would I go about sorting this array?
asked Jan 02 '15 at 02:24 PM in C++ Programming
TArray.Sort() has two overloads. The first one doesn't take and arguments, so you can just call MyStringArray.Sort() and it will sort alphanumerically, no predicate logic required.
answered Jan 02 '15 at 05:53 PM
If you want to sort it by yourself you could just go through the array with a loop and check which string is smaller with the normal comparison operator. Every kind of sorting algorithm should work.
Don't have time testing this at the moment.
answered Jan 02 '15 at 03:00 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here