Removes any whitespace padding from the end of a string
| 1520 | |
| 1521 | // Removes any whitespace padding from the end of a string |
| 1522 | void RemoveTrailingWhitespace(char *s) { |
| 1523 | int last_char_pos; |
| 1524 | |
| 1525 | last_char_pos = strlen(s) - 1; |
| 1526 | while (last_char_pos >= 0 && isspace(s[last_char_pos])) { |
| 1527 | s[last_char_pos] = '\0'; |
| 1528 | last_char_pos--; |
| 1529 | } |
| 1530 | } |
| 1531 | |
| 1532 | // Returns a pointer to the first non-whitespace char in given string |
| 1533 | char *SkipInitialWhitespace(char *s) { |