Advertisement
luisgustavomiki

Cutleft

Aug 6th, 2012
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.41 KB | None | 0 0
  1. stock param_cutleft(str[])
  2. {
  3.     new len = strlen(str[]),
  4.         index = -1;
  5.        
  6.     if(!len)
  7.         return 0;
  8.        
  9.     new
  10.         ignorespaces = 1;
  11.        
  12.     while(++index < len)
  13.     {
  14.         if(str[index] == EOS)
  15.         {
  16.             str[0] = 0;
  17.             return 0;
  18.         }
  19.        
  20.         if(str[index] == ' ')
  21.         {
  22.             if(ignorespaces)
  23.                 continue;
  24.                
  25.             strdel(str, 0, index);
  26.             return 1;
  27.         }
  28.         else
  29.             if(ignorespaces)
  30.                 ignorespaces = 0;
  31.     }
  32.     return 1;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement