From 442921c7bd93e9e111845de6c22f66753b41e11a Mon Sep 17 00:00:00 2001 From: Paul Jungeblut Date: Thu, 6 Oct 2016 00:17:59 +0200 Subject: Renamin sonstiges ot other. --- other/split.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 other/split.cpp (limited to 'other/split.cpp') diff --git a/other/split.cpp b/other/split.cpp new file mode 100644 index 0000000..ea7d5ff --- /dev/null +++ b/other/split.cpp @@ -0,0 +1,9 @@ +vector split(string &s, string delim) { // Zerlegt s anhand aller Zeichen in delim. + vector 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 -- cgit v1.2.3