Advertisement
Shiny_

str_del_free_space

Aug 24th, 2013 (edited)
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.33 KB | None | 0 0
  1. stock str_del_free_space(string_[], _char = ' ') {
  2.     new len = strlen(string_);
  3.     if(len) {
  4.         new begin = -1, end = len;
  5.         while(string_[++begin] == _char){}
  6.         if(string_[begin] == EOS) {
  7.             string_[0] = 0;
  8.             return 1;
  9.         }
  10.         while(string_[--end] == _char) {}
  11.         strmid(string_, string_, begin, end+1, len+1);
  12.     }
  13.     return true;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement