32 lines
536 B
C++
32 lines
536 B
C++
|
|
#include "utils.hpp"
|
|
|
|
std::vector<std::string> split(std::string input, char delimiter)
|
|
{
|
|
std::vector<std::string> answer;
|
|
std::stringstream ss(input);
|
|
std::string temp;
|
|
|
|
while (getline(ss, temp, delimiter))
|
|
answer.push_back(temp);
|
|
|
|
return answer;
|
|
}
|
|
|
|
std::string trim(std::string str, char c)
|
|
{
|
|
str = str.substr(str.find_first_not_of(c));
|
|
str = str.substr(0, str.find_last_not_of(c) + 1);
|
|
|
|
return str;
|
|
}
|
|
|
|
std::string itoa(int n)
|
|
{
|
|
std::stringstream strs;
|
|
|
|
strs << n;
|
|
return ( strs.str() );
|
|
}
|
|
|