Removes any whitespace padding from the end of a string
| 1372 | |
| 1373 | // Removes any whitespace padding from the end of a string |
| 1374 | void RemoveTrailingWhitespace(char *s) { |
| 1375 | int last_char_pos; |
| 1376 | |
| 1377 | last_char_pos = strlen(s) - 1; |
| 1378 | while (last_char_pos >= 0 && isspace(s[last_char_pos])) { |
| 1379 | s[last_char_pos] = '\0'; |
| 1380 | last_char_pos--; |
| 1381 | } |
| 1382 | } |
| 1383 | |
| 1384 | // Returns a pointer to the first non-whitespace char in given string |
| 1385 | char *SkipInitialWhitespace(char *s) { |