Is there a built in function for std::string in C++ to compare two strings alphabetically when either string can be uppercase or lowercase?

后端 未结 5 510
盖世英雄少女心
盖世英雄少女心 2021-01-18 06:08

I know for C++ that basic comparative operators can accomplish the task if both words are either entirely lower or entirely upper case. I have an array of strings and letter

5条回答
  •  无人及你
    2021-01-18 07:04

    You can use Boost String Algorithms:

    #include 
    #include 
    
    #include 
    
    int main() {
        std::string s { "Test" };
        assert(boost::iequals(s, "TEST"));
    }
    

提交回复
热议问题