C ++ 11-- string letter case change

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/liangzhao_jay/article/details/87785504

Sample code is as follows,

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

void transformLiteral()
{
    string strA("[email protected]");
    string strB("[email protected]");
    
    transform(strA.begin(), strA.end(), strA.begin(), ::toupper);
    transform(strB.begin(), strB.end(), strB.begin(), ::tolower);      
}

int main()
{
    transformLiteral();
    return 0;
}

 

Guess you like

Origin blog.csdn.net/liangzhao_jay/article/details/87785504