summaryrefslogtreecommitdiff
path: root/other/split.cpp
blob: ea7d5ffa079def83126d84a09dd09e3757c3dc73 (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;
}