diff --git a/src/utils/StringUtils.cpp b/src/utils/StringUtils.cpp index 4234a68f..f33db48c 100644 --- a/src/utils/StringUtils.cpp +++ b/src/utils/StringUtils.cpp @@ -204,4 +204,23 @@ void cleanString(String& str) { for (size_t i = 0; i < str.length(); i++) { if (allowedChars.indexOf(str.charAt(i)) == -1) str.setCharAt(i, ' '); } +} + +std::vector splitStr(const String& str, const String& delimiter) { + std::vector result; + size_t newPos, pos = 0; + while ((newPos = str.indexOf(delimiter, pos)) != -1) { + result.push_back(str.substring(pos, newPos)); + pos = newPos + delimiter.length(); + } + result.push_back(str.substring(pos)); + return result; +} + + +bool strInVector(const String& str, const std::vector& vec) { + for (size_t i = 0; i < vec.size(); i++) { + if (vec[i] == str) return true; + } + return false; } \ No newline at end of file