diff options
| author | Paul Jungeblut <s_jungeb@i08pc79.atis-stud.uni-karlsruhe.de> | 2014-11-26 11:46:02 +0100 |
|---|---|---|
| committer | Paul Jungeblut <s_jungeb@i08pc79.atis-stud.uni-karlsruhe.de> | 2014-11-26 11:46:02 +0100 |
| commit | 7a217262958cdf11dfb1f90b86df31acde90ff45 (patch) | |
| tree | 8d96850058853910ebf2ef75827b0862180fd0c1 /convenience/split.cpp | |
| parent | 2c133b76f193478bb85d41a76ae78695cc067452 (diff) | |
| parent | 24507ee02a8fe20fb22ae30642e3b15e411e82eb (diff) | |
merge
Diffstat (limited to 'convenience/split.cpp')
| -rw-r--r-- | convenience/split.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/convenience/split.cpp b/convenience/split.cpp new file mode 100644 index 0000000..d7628f3 --- /dev/null +++ b/convenience/split.cpp @@ -0,0 +1,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; +}
\ No newline at end of file |
