Removes any whitespace padding from the end of a string
| 234 | |
| 235 | // Removes any whitespace padding from the end of a string |
| 236 | void RemoveTrailingWhitespace(char *s) { |
| 237 | int last_char_pos; |
| 238 | |
| 239 | last_char_pos = strlen(s) - 1; |
| 240 | while (last_char_pos >= 0 && isspace(s[last_char_pos])) { |
| 241 | s[last_char_pos] = '\0'; |
| 242 | last_char_pos--; |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | // Returns a pointer to the first non-whitespace char in given string |
| 247 | char *SkipInitialWhitespace(char *s) { |