Guest User

Untitled

a guest
Apr 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. int InputParser_TrimCharactersEnd(char * inpt , unsigned int length,char what2trim)
  2. {
  3. if ( length==0 ) { return 1;}
  4. if ( (length==1) && (inpt[0]==what2trim) ) { inpt[0]=0; return 1; } else
  5. { return 1; }
  6.  
  7. unsigned int i;
  8. i=length-1;
  9. while ((inpt[i]==what2trim)&&(i>0)) { --i; }
  10. if ((i==0) && (inpt[0]==what2trim) ) { inpt[0]=0; } else
  11. {
  12. inpt[i]=0;
  13. }
  14. return 1;
  15. }
Add Comment
Please, Sign In to add comment