Removes any whitespace padding from the end of a string
| 193 | |
| 194 | // Removes any whitespace padding from the end of a string |
| 195 | void RemoveTrailingWhitespace(char *s) { |
| 196 | int last_char_pos; |
| 197 | |
| 198 | last_char_pos = strlen(s) - 1; |
| 199 | while (last_char_pos >= 0 && isspace(s[last_char_pos])) { |
| 200 | s[last_char_pos] = '\0'; |
| 201 | last_char_pos--; |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | // Returns a pointer to the first non-whitespace char in given string |
| 206 | char *SkipInitialWhitespace(char *s) { |