cbanks Active Member Licensed User Longtime User Apr 17, 2012 #1 I have the following code and it sorts Capitalized words before words that are lower case. Is there a way to fix that? list1.Sort(True) So, if my list was the following: apple dog Zebra Cat It sorts it like this: Cat Zebra apple dog I want it to sort like this: apple Cat dog Zebra
I have the following code and it sorts Capitalized words before words that are lower case. Is there a way to fix that? list1.Sort(True) So, if my list was the following: apple dog Zebra Cat It sorts it like this: Cat Zebra apple dog I want it to sort like this: apple Cat dog Zebra
Ricky D Well-Known Member Licensed User Longtime User Apr 17, 2012 #2 What I'd do is create a map putting keys as your values capitalized and your values in the value field then sort the map on the keys, building your list from that. I have to admit I don't know how to sort a map. Regards Ricky Upvote 0
What I'd do is create a map putting keys as your values capitalized and your values in the value field then sort the map on the keys, building your list from that. I have to admit I don't know how to sort a map. Regards Ricky
Ricky D Well-Known Member Licensed User Longtime User Apr 17, 2012 #3 On second thoughts I'd throw the map keys & values into an sqlite table then read the table ordered by the key Upvote 0
On second thoughts I'd throw the map keys & values into an sqlite table then read the table ordered by the key
M Mahares Expert Licensed User Longtime User Apr 17, 2012 #4 Another approach: If you do not mind them all appearing as lower or upper casein the list: Code: Copy Dim list1 As List list1.Add("cbanks".ToUpperCase) 'or list1.Add("cbanks".ToLowerCase) list1.Sort(True) If I am not understanding the question, please ignore Mahares Upvote 0
Another approach: If you do not mind them all appearing as lower or upper casein the list: Code: Copy Dim list1 As List list1.Add("cbanks".ToUpperCase) 'or list1.Add("cbanks".ToLowerCase) list1.Sort(True) If I am not understanding the question, please ignore Mahares
margret Well-Known Member Licensed User Longtime User Apr 17, 2012 #5 The easiest option might be: Code: Copy List1.SortCaseInsensitive(True) Upvote 0