text: #include "Util.h"
  
  #include "util.h"
  
  std::vector<std::string> Util::split(const std::string& s, char delim)
  {
  	std::vector<std::string> elems;
  
  	const char* cstr = s.c_str();
  	unsigned int strLength = (unsigned int)s.length();
  	unsigned int start = 0;
  	unsigned int end = 0;
  
  	while (end <= strLength)
  	{
  		while (end <= strLength)
  		{
  			if (cstr[end] == delim)
  				break;
  			end++;
  		}
  
  		elems.push_back(s.substr(start, end - start));
  		start = end + 1;
  		end = start;
  	}
  
  	return elems;
  }
  
  std::string Util::trim(const std::string& str, const std::string& whitespace)
  {
  	const auto strBegin = str.find_first_not_of(whitespace);
  	if (strBegin == std::string::npos)
  		return ""; 
  
  	const auto strEnd = str.find_last_not_of(whitespace);
  	const auto strRange = strEnd - strBegin + 1;
  
  	return str.substr(strBegin, strRange);
  }
  