func:可以基本显示目标结果。

This commit is contained in:
2024-05-15 10:59:43 +08:00
parent 5cd8cec2a3
commit faa64d7ba2
16 changed files with 5670 additions and 8 deletions

18
public_def.cpp Normal file
View File

@@ -0,0 +1,18 @@
#include "public_def.h"
std::vector<std::string> splitString(const std::string& input, const std::string& delimiter) {
std::vector<std::string> tokens;
size_t pos = 0;
std::string backup = input;
std::string token;
while ((pos = backup.find(delimiter)) != std::string::npos) {
token = backup.substr(0, pos);
tokens.push_back(token);
backup.erase(0, pos + delimiter.length());
}
// Push the remaining part after the last delimiter
tokens.push_back(backup);
return tokens;
}