int ProcessString(char * strInput,char *strOutput)
{
if(!strInput) return -1;//判断字符串是否为空
int index=0;
while(*strInput)
{
if((('a'<=(*strInput))&&((*strInput)<='z'))||(('A'<=(*strInput))&&((*strInput)<='Z')))
{
if(('A'<=(*strInput))&&((*strInput)<='Z'))
{
strOutput[index]=(*strInput)+32;
strInput++;
index++;
}
else
{
strOutput[index]=*strInput;
strInput++;
index++;
}
}
else
{
strInput++;
}
}
strOutput[index]=0;
if(!strOutput) return -1;
return 0;
}
字符串小写转换
最新推荐文章于 2024-05-26 17:36:40 发布