Remove repeat char from a string
i search in google to find the solution remove repeat char from a string, but failed. so write it by myselft....
i use C.
char * RemoveRepeatChar(char *S){
char *temp=S, *move;
//1. base ==Null
if(*s) return null;
while(*S){
temp = s+1;
while(*temp){
//repeat char
if(*temp == *S)
{
move = temp;
while(*move)
*move++=*(move+1);
}
else
temp++;
}
S++;
}
}
i use C.
char * RemoveRepeatChar(char *S){
char *temp=S, *move;
//1. base ==Null
if(*s) return null;
while(*S){
temp = s+1;
while(*temp){
//repeat char
if(*temp == *S)
{
move = temp;
while(*move)
*move++=*(move+1);
}
else
temp++;
}
S++;
}
}