Removes any whitespace padding from the end of a string
| 208 | |
| 209 | // Removes any whitespace padding from the end of a string |
| 210 | void RemoveTrailingWhitespace(char *s) { |
| 211 | int last_char_pos; |
| 212 | |
| 213 | last_char_pos = strlen(s) - 1; |
| 214 | while (last_char_pos >= 0 && isspace(s[last_char_pos])) { |
| 215 | s[last_char_pos] = '\0'; |
| 216 | last_char_pos--; |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | // Returns a pointer to the first non-whitespace char in given string |
| 221 | char *SkipInitialWhitespace(char *s) { |