aboutsummaryrefslogtreecommitdiff
path: root/utils.h
blob: f713da8a22e7038e6676535ec98115f62a18f04f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#ifndef UTILS_H
#define UTILS_H

void split (std::vector<std::string> &vec, std::string str, std::string del) {
    auto token = str.find(del);
    if (token != std::string::npos) {
        vec.push_back(str.substr(0, token));
        split(vec, str.substr(token+del.size()), del);
    } else { vec.push_back(str); }
}

#endif