From 9e625b89bac7e8daaf583e215f3a0df3dc250bb2 Mon Sep 17 00:00:00 2001 From: Paul Jungeblut Date: Mon, 27 Jun 2016 11:17:34 +0200 Subject: Math section rebuild, merged convinience and sonstiges section. --- sonstiges/split.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sonstiges/split.cpp (limited to 'sonstiges/split.cpp') 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 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