hello all,
I know there is a function in algorithm class called sort()
but I need to sort ignoring the case of the alphabet
Is there any function that does that ?
thank you
1 2 3 4 5 6 7
|
std::sort(std::begin(myvector), std::end(myvector), [](std::string const &a, std::string const &b)
{
return std::lexicographical_compare(std::begin(a), std::end(a), std::begin(b), std::end(b), [](std::string::value_type a, std::string::value_type b)
{
return std::tolower(a) < std::tolower(b); //case-insensitive
});
});
|
http://ideone.com/N6sq6X
Last edited on