字符串中大小写转换

tech2023-02-28  111

知识点:toupper 转为大写 tolower 转为小写

void test10() { string str = “AbCdEfg”; for (int i=0;i<str.size();i++) { str[i] = toupper(str[i]); //转大写 //str[i] = tolower(str[i]); //转小写

} cout << str << endl;

}

最新回复(0)