summaryrefslogtreecommitdiff
path: root/src/utils/string.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/string.cpp')
-rw-r--r--src/utils/string.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/utils/string.cpp b/src/utils/string.cpp
new file mode 100644
index 0000000..bb590ca
--- /dev/null
+++ b/src/utils/string.cpp
@@ -0,0 +1,18 @@
+#include "string.hpp"
+
+#include <sstream>
+
+namespace silly::editor::utils {
+ std::vector<std::string> split_text(const std::string &text, char delimiter) {
+ std::vector<std::string> parts;
+
+ std::istringstream iss(text);
+ std::string part;
+
+ while (std::getline(iss, part, delimiter)) {
+ parts.push_back(part);
+ }
+
+ return parts;
+ }
+} \ No newline at end of file