README.md

December 4, 2022 ยท View on GitHub

strrtrim

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
ByMan In Limbo
LevelBeginner
User Rating4.0 (8 globes from 2 users)
CompatibilityC, C++ (general)
CategoryStrings
WorldC / 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;
}