Home > Back-end >  How to use a for loop delete strings behind the stars
How to use a for loop delete strings behind the stars

Time:03-06

How to use a for loop to remove strings behind the stars behind how to use a for loop to delete a string of stars

CodePudding user response:

 # include & lt; Stdio. H> 
# include & lt; String. H>
Int main () {
Char [] s="ABC * d * *";
Int I, L;
L=strlen (s);
For (I=L - 1; I>=0; I -) {
[I] if (s=='*') s [I]=0;
The else break;
}
Printf (" s:] [% s \ n ", s); ABC *//s: [d]
return 0;
}

CodePudding user response:

Post your code to find the stars, with '\ 0' cover, directly behind if the stars continue to, is the back of the cover ~ forward
  • Related