mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 16:20:03 +02:00
33 lines
775 B
C++
Executable File
33 lines
775 B
C++
Executable File
|
|
#include "string_utils.h"
|
|
#include "container_utils.h"
|
|
#include "network_utils.h"
|
|
#include <algorithm>
|
|
#include <iomanip>
|
|
#include <sstream>
|
|
namespace sls {
|
|
|
|
std::vector<std::string> split(const std::string &strToSplit, char delimeter) {
|
|
std::stringstream ss(strToSplit);
|
|
std::string item;
|
|
std::vector<std::string> splittedStrings;
|
|
while (std::getline(ss, item, delimeter)) {
|
|
splittedStrings.push_back(item);
|
|
}
|
|
return splittedStrings;
|
|
}
|
|
|
|
std::string RemoveUnit(std::string &str) {
|
|
auto it = str.begin();
|
|
while (it != str.end()) {
|
|
if (std::isalpha(*it))
|
|
break;
|
|
++it;
|
|
}
|
|
auto pos = it - str.begin();
|
|
auto unit = str.substr(pos);
|
|
str.erase(it, end(str));
|
|
return unit;
|
|
}
|
|
|
|
}; // namespace sls
|