oss_src/util/stl_util.hpp
inline std::string trim(const std::string& str) {
    std::string::size_type pos1 = str.find_first_not_of(" \t");
    std::string::size_type pos2 = str.find_last_not_of(" \t");
    return str.substr(pos1 == std::string::npos ? 0 : pos1,
                      pos2 == std::string::npos ? str.size()-1 : pos2-pos1+1);
  }
/** Removes white space (space and tabs) from the beginning and end of str,
      returning the resultant string
  */
Removes white space (space and tabs) from the beginning and end of str,
returning the resultant string
Removes white space ( space and tabs ) from the beginning and end of str returning the resultant string
inline std::string trim(const std::string& str) {
    std::string::size_type pos1 = str.find_first_not_of(" \t");
    std::string::size_type pos2 = str.find_last_not_of(" \t");
    return str.substr(pos1 == std::string::npos ? 0 : pos1,
                      pos2 == std::string::npos ? str.size()-1 : pos2-pos1+1);
  }
inline std :: string trim ( const std :: string & str ) { std :: string :: size_type pos1 = str . find_first_not_of ( " \t " ) ; std :: string :: size_type pos2 = str . find_last_not_of ( " \t " ) ; return str . substr ( pos1 == std :: string :: npos ? 0 : pos1 , pos2 == std :: string :: npos ? str . size ( ) - 1 : pos2 - pos1 + 1 ) ; }
Removes white space (space and tabs) from the beginning and end of str,
returning the resultant string
Removes white space ( space and tabs ) from the beginning and end of str returning the resultant string