Advertisement
Chdata

Untitled

Aug 11th, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. MaxMessageLength = MAXLENGTH_MESSAGE - strlen(name) - 5;
  2. LeftTrim(message, message, MaxMessageLength, 9);
  3.  
  4.  
  5.  
  6.  
  7. /**
  8. * Trims a string by removing the specified amount of chars from the beginning (including whitespace).
  9. * The Output String can be the same as the Input String.
  10. *
  11. * @param str Input String.
  12. * @param output Output String (Can be the as the input).
  13. * @param size Size of the output String.
  14. * @param chars Amount of characters to remove.
  15. * @noreturn
  16. */
  17. stock LeftTrim(const String:str[], String:output[], size, chars)
  18. {
  19. new x=0;
  20. while (str[x] != '\0' && x<chars)
  21. {
  22. x++;
  23. }
  24.  
  25. x = strcopy(output, size, str[x]);
  26. x--;
  27.  
  28. while (x >= 0 && x<chars)
  29. {
  30. x--;
  31. }
  32.  
  33. output[++x] = '\0';
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement