summaryrefslogtreecommitdiff
path: root/sonstiges/split.cpp
diff options
context:
space:
mode:
authorPaul Jungeblut <paul.jungeblut@gmail.com>2016-06-27 11:17:34 +0200
committerPaul Jungeblut <paul.jungeblut@gmail.com>2016-06-27 11:17:34 +0200
commit9e625b89bac7e8daaf583e215f3a0df3dc250bb2 (patch)
treeab295455fce73f726bd97a325a61d95aca77a508 /sonstiges/split.cpp
parent5bb1ac05882e0df43a2afe0c363e0f503f51c357 (diff)
Math section rebuild, merged convinience and sonstiges section.
Diffstat (limited to 'sonstiges/split.cpp')
-rw-r--r--sonstiges/split.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/sonstiges/split.cpp b/sonstiges/split.cpp
new file mode 100644
index 0000000..ea7d5ff
--- /dev/null
+++ b/sonstiges/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