2023-08-01 00:42:49 +03:00
|
|
|
#include <algorithm>
|
|
|
|
#include <sstream>
|
|
|
|
#include <string>
|
2023-11-05 13:41:10 +02:00
|
|
|
#include "common/string_util.h"
|
2023-08-01 00:42:49 +03:00
|
|
|
|
2023-11-05 16:56:28 +02:00
|
|
|
namespace Common {
|
2023-08-01 00:42:49 +03:00
|
|
|
|
2023-11-05 16:56:28 +02:00
|
|
|
std::vector<std::string> SplitString(const std::string &str, char delimiter) {
|
|
|
|
std::istringstream iss(str);
|
|
|
|
std::vector<std::string> output(1);
|
2023-08-01 00:42:49 +03:00
|
|
|
|
2023-11-05 16:56:28 +02:00
|
|
|
while (std::getline(iss, *output.rbegin(), delimiter)) {
|
|
|
|
output.emplace_back();
|
2023-08-01 00:42:49 +03:00
|
|
|
}
|
2023-11-05 16:56:28 +02:00
|
|
|
|
|
|
|
output.pop_back();
|
|
|
|
return output;
|
2023-08-01 00:42:49 +03:00
|
|
|
}
|
|
|
|
|
2023-11-05 16:56:28 +02:00
|
|
|
} // namespace Common
|