transform(str.begin(), str.end(), str.begin(), ::tolower);
cout << "转小写: " << str << endl;
transform(str.begin(), str.end(), str.begin(), ::toupper);
cout << "转大写: " << str << endl;
将大小写统一之后就能当作忽略大小写了。
transform(str.begin(), str.end(), str.begin(), ::tolower);
cout << "转小写: " << str << endl;
transform(str.begin(), str.end(), str.begin(), ::toupper);
cout << "转大写: " << str << endl;
将大小写统一之后就能当作忽略大小写了。