summaryrefslogtreecommitdiff
path: root/convenience/split.cpp
blob: d7628f3cb8c7a0c732ec6ee7b787403c10edae87 (plain)
1
2
3
4
5
6
7
8
9
vector<string> split(string &s, string delim) { //zerlegt s anhand aller Zeichen in delim
	vector<string> result; char *token;
	token = strtok((char*)s.c_str(), (char*)delim.c_str());
	while (token != NULL) {
		result.push_back(string(token));
		token = strtok(NULL, (char*)delim.c_str());
	}
	return result;
}