You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
498 B
C++
26 lines
498 B
C++
//
|
|
// Created by koncord on 04.03.17.
|
|
//
|
|
|
|
#include "Utils.hpp"
|
|
|
|
using namespace std;
|
|
|
|
const vector<string> Utils::split(const string &str, int delimiter)
|
|
{
|
|
string buffer;
|
|
vector<string> result;
|
|
|
|
for (auto symb:str)
|
|
if (symb != delimiter)
|
|
buffer += symb;
|
|
else if (!buffer.empty())
|
|
{
|
|
result.push_back(move(buffer));
|
|
buffer.clear();
|
|
}
|
|
if (!buffer.empty())
|
|
result.push_back(move(buffer));
|
|
|
|
return result;
|
|
} |