src/StringFix.cpp
/** Trims a string's end and beginning from specified characters
    *        such as tab, space and newline i.e. "\t \n" (tab space newline)
    * @param str to clean
    * @param whitespace by default space and tab character
    * @return the cleaned string */
Trims a string's end and beginning from specified characters
such as tab, space and newline i.e. "\t \n" (tab space newline)
@param str to clean
@param whitespace by default space and tab character
@return the cleaned string
Trims a string ' s end and beginning from specified characters such as tab space and newline i . e . " \ t \ n " ( tab space newline ) @param str to clean @param whitespace by default space and tab character @return the cleaned string
std::string trim(const std::string& str, const std::string& whitespace) {
      const auto& begin = str.find_first_not_of(whitespace);
      if (std::string::npos == begin) {
         return {};
      }
      const auto& end = str.find_last_not_of(whitespace);
      const auto& range = end - begin + 1;
      return str.substr(begin, range);
   }
std :: string trim ( const std :: string & str , const std :: string & whitespace ) { const auto & begin = str . find_first_not_of ( whitespace ) ; if ( std :: string :: npos == begin ) { return { } ; } const auto & end = str . find_last_not_of ( whitespace ) ; const auto & range = end - begin + 1 ; return str . substr ( begin , range ) ; }
Trims a string's end and beginning from specified characters
        such as tab, space and newline i.e.
Trims a string ' s end and beginning from specified characters such as tab space and newline i . e .