Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int InputParser_TrimCharactersEnd(char * inpt , unsigned int length,char what2trim)
- {
- if ( length==0 ) { return 1;}
- if ( (length==1) && (inpt[0]==what2trim) ) { inpt[0]=0; return 1; } else
- { return 1; }
- unsigned int i;
- i=length-1;
- while ((inpt[i]==what2trim)&&(i>0)) { --i; }
- if ((i==0) && (inpt[0]==what2trim) ) { inpt[0]=0; } else
- {
- inpt[i]=0;
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment