#include<stdio.h>
#include<stdlib.h>
#include<string.h>
//void trimSpace(char *inbuf)
void trimSpace(char *inbuf)
{
//int i;
char* vector1 = inbuf;
while (*inbuf != '\0')
{
if (*inbuf == 32)
{
++vector1;
*inbuf = *vector1;
*vector1 = 32;
//*inbuf = 'a';
}
else
{
++inbuf;
vector1 = inbuf;
}
//char* vector1=inbuf;
}
}
int main()
{
char str1[] = "oracle_pwd = 123456";
trimSpace(str1);
printf("%s\n", str1);
system("pause");
return 0;
}
c/c++程序总结——去除空格
最新推荐文章于 2024-05-06 10:59:50 发布