std::string trim(const std::string& s)
{
if(s.length() == 0)
return s;
std::size_t beg = s.find_first_not_of(" \a\b\f\n\r\t\v");
std::size_t end = s.find_last_not_of(" \a\b\f\n\r\t\v");
if(beg == std::string::npos) // No non-spaces
return "";
return std::string(s, beg, end - beg + 1);
}
감사합니다 Thank you
ReplyDelete