include/StringUtils.hxx
// strip any trailing character in what (if not specified, any white space)
strip any trailing character in what (if not specified, any white space)
strip any trailing character in what ( if not specified any white space )
inline std::string rstrip(const std::string &s, const std::string &what = " \t\n\r")
{
	std::string::size_type last = s.find_last_not_of(what);
	if (last == std::string::npos)
		return ""; 
	std::string::size_type b = 0;
	std::string::size_type e = last+1;
	return s.substr(b, e-b);
}
inline std :: string rstrip ( const std :: string & s , const std :: string & what = " \t \n \r " ) { std :: string :: size_type last = s . find_last_not_of ( what ) ; if ( last == std :: string :: npos ) return " " ; std :: string :: size_type b = 0 ; std :: string :: size_type e = last + 1 ; return s . substr ( b , e - b ) ; }
strip any trailing character in what (if not specified, any white space)
strip any trailing character in what ( if not specified any white space )
// input string was all white space (or empty)