fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <cctype>
  4. #include <algorithm>
  5.  
  6. int main()
  7. {
  8. std::string mystring
  9. {
  10. "AaABbB"
  11. };
  12. std::sort(std::begin(mystring), std::end(mystring), [](std::string::value_type const &a, std::string::value_type const &b)
  13. {
  14. return std::tolower(a) < std::tolower(b);
  15. });
  16. std::cout << mystring << std::endl;
  17. }
  18.  
Success #stdin #stdout 0s 3432KB
stdin
Standard input is empty
stdout
AaABbB