This documentation is automatically generated by online-judge-tools/verification-helper
#include "string/split.hpp"#pragma once
#include "./base.hpp"
#include <string>
#include <vector>
namespace matumoto {
vector<string> split(const string &str, const string &sep, const int &max_split = INT32_MAX) {
vector<string> res;
string t = "";
int cnt_split = 0;
for (auto c: str) {
if (sep.find(c) == string::npos or cnt_split >= max_split) {
t += c;
continue;
}
res.emplace_back(t);
t = "";
cnt_split++;
}
if (t != "")
res.emplace_back(t);
return res;
}
} // namespace matumoto#line 2 "string/split.hpp"
#line 2 "string/base.hpp"
namespace matumoto {
using namespace std;
}
#line 4 "string/split.hpp"
#include <string>
#include <vector>
namespace matumoto {
vector<string> split(const string &str, const string &sep, const int &max_split = INT32_MAX) {
vector<string> res;
string t = "";
int cnt_split = 0;
for (auto c: str) {
if (sep.find(c) == string::npos or cnt_split >= max_split) {
t += c;
continue;
}
res.emplace_back(t);
t = "";
cnt_split++;
}
if (t != "")
res.emplace_back(t);
return res;
}
} // namespace matumoto