TrimRight
Trim trailing whitespace characters from the string. It removes trailing newline, space, and tab characters.
Remove a particular character from the end of a string.
Remove a group of particular characters from the end of the string.
void TrimRight( )
void TrimRight( char chTarget )
void TrimRight( LPCSTR lpszTargets )
None.
EX1
//Trim right whitespace characters from the string void string_TrimRight_ex1() { string str="Hello World "; str.TrimRight(); out_str(str);//"Hello World" }
EX2
//Removes a particular character from the end of the string void string_TrimRight_ex2() { string str="aaabbbcccaaa"; str.TrimRight('a'); out_str(str);//"aaabbbccc" }
EX3
//Removes a group of particular characters from the end of the string void string_TrimRight_ex3() { string str = _L("**##Origin is good!***** ######"); str.TrimRight("* #"); out_str(str);//"**##Origin is good!" }
string::Format, string::Left, string::MakeLower, string::MakeUpper, string::Mid, string::Right
origin.h