string 大小写的转换,利用transform函数, 将string cmdContent 进行大小写转换。
transform(cmdContent.begin(), cmdContent.end(), cmdContent.begin(), ::toupper);//转换为大写
transform(cmdContent.begin(), cmdContent.end(), cmdContent.begin(), ::tolower); //转换为小写
单个字符的转换:
while((*ContentTemp) != '\0') //获取路径
{
char pathTemp[256] = {0};
int i = 0;
while((*ContentTemp) != ' ' && (*ContentTemp) != '\0' && i < 256)
{
pathTemp[i++] = tolower(*ContentTemp);
ContentTemp++;
}
if(i>= 256)
{
cout << "参数路径过长" << endl;
isOk = false;
return false;
}
ContentTemp = delSpace(ContentTemp);
vecPath.push_back(pathTemp);
}