由于C++的string没有提供英文大小写转换的功能(显然不会提供这么简单、琐碎的功能),只好结合C标准库和string提供的transform来实现大小写转换了。 transform(str.begin(),str.end(),str.begin(),tolower); 很简单。