mirror of
https://github.com/BotChain-Robots/rpc.git
synced 2026-03-09 23:12:27 +01:00
Prepare files for public release
This commit is contained in:
23
include/util/string.h
Normal file
23
include/util/string.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Created by Johnathon Slightham on 2025-07-05.
|
||||
//
|
||||
|
||||
#ifndef STRING_H
|
||||
#define STRING_H
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
inline std::vector<std::string> split(const std::string &str, const char delimiter) {
|
||||
std::vector<std::string> result;
|
||||
std::stringstream ss(str);
|
||||
std::string token;
|
||||
|
||||
while (std::getline(ss, token, delimiter)) {
|
||||
result.push_back(token);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif //STRING_H
|
||||
Reference in New Issue
Block a user