/*
功能:
输入:
输出:
返回:成功0,其它-1
*/
int ProcessString( char * strInput,char chSrc,char chDes ,char * strOutput)
{
int index = 0;
if ((NULL == strInput) || (NULL == strOutput) || (chSrc == '\0') || (chDes == '\0') )
return -1;
while( strInput[index] != '\0' )
{
strOutput[index] = strInput[index];
if(strInput[index] == chSrc)
{
strOutput[index] = chDes;
}
index++;
}
strOutput[index] = '\0';
return 0;
}
/*
功能:
输入:
输出:
返回:成功0,其它-1
*/
int ProcessString( char * strInput,char chSrc,char chDes ,char * strOutput)
{
int index = 0;
if ((NULL == strInput) || (NULL == strOutput) || (chSrc == '\0') || (chDes == '\0') )
return -1;
while( strInput[index] != '\0' )
{
strOutput[index] = strInput[index];
if(strInput[index] == chSrc)
{
strOutput[index] = chDes;
}
index++;
}
strOutput[index] = '\0';
return 0;
}