FTSLib 0.1.1
A simple C++ library for decoding FTS (FloweyTaleSave) files.
Loading...
Searching...
No Matches
split.hpp
Go to the documentation of this file.
1#ifndef SPLIT_HPP
2#define SPLIT_HPP
3
4#include <string>
5#include <vector>
6
7inline std::vector<std::string> split(const std::string& str, const std::string& delimiter) {
8 std::vector<std::string> tokens;
9 size_t start = 0;
10 size_t end = 0;
11 while ((end = str.find(delimiter, start)) != std::string::npos) {
12 tokens.push_back(str.substr(start, end - start));
13 start = end + delimiter.length();
14 }
15 tokens.push_back(str.substr(start));
16 return tokens;
17}
18
19#endif
std::vector< std::string > split(const std::string &str, const std::string &delimiter)
Definition split.hpp:7