README.md
December 4, 2022 ยท View on GitHub
Description
Removes trailing spaces from the end of a string. See "trim" to remove leading spaces.
More Info
the string
the trimmed string
| Submitted On | |
| By | Man In Limbo |
| Level | Beginner |
| User Rating | 4.0 (8 globes from 2 users) |
| Compatibility | C, C++ (general) |
| Category | Strings |
| World | C / C++ |
| Archive File |
Source Code
/* strrtrim : removes trailing spaces from the end of a string*/
static char* strrtrim( char* s)
{
int i;
if (s) {
i = strlen(s); while ((--i)>0 && isspace(s[i]) ) s[i]=0;
}
return s;
}