sorting std::vector<string> ignoring case



I need to sort a vector of strings ignoring case while preserving it.
That is, if I have a vector containing "Xyz" and "abc" I
want to report "abc" "Xyz". I can think of several inelegant ways,
such as creating a second vector with all upper (or lower)
and sort it while saving the sort order in an integer array, using the
latter to index the while reporting the original vector...
that is, an indirect sort. But I was wondering if there was some why
of accomplishing this more directly with the
STL algorithms.

Any thoughts?

TIA

Ed



.



Relevant Pages

  • Re: Sort blocks of data as if each block was a single record
    ... When you sort the visible rows, ... Collapse all groups (by clicking the in the upper left) ...  In the first row of each block(and only the first row ... sort based on that identifier, but each block has to stay in tact. ...
    (microsoft.public.excel.programming)
  • Re: Unique Listbox Sort Order
    ... The items in the listbox are alphanumeric strings, either all Upper Case ... What is the easiest way to sort the listbox with all lower case items ...
    (microsoft.public.vb.general.discussion)
  • Re: sort -m and locale?
    ... problem they messed up the month code in sort. ... months from the system using the locale information. ... The months from the system are in upper and lower ... In the end I put up a red herring for everyone to follow with the locale ...
    (comp.unix.shell)
  • Unique Listbox Sort Order
    ... I would like to sort the contents of a listbox... ... What is the easiest way to sort the listbox with all lower case items listed ... first in alphabetical order and then the upper case items in alphabetical ...
    (microsoft.public.vb.general.discussion)
  • Re: sorting a list
    ... Sean Berry wrote: ... if lower can come before upper. ... try the new sort() in Python 2.4. ...
    (comp.lang.python)

Loading