#pragma once #include "string.hpp" template requires Container && HasPushBack && std::same_as auto split_string(const String &str, Char delimiter) noexcept -> ContainerType { auto result_container = ContainerType(); auto str_copy = str; size_t pos = 0; String token; while ((pos = str_copy.find(delimiter)) != String::npos) { token = str_copy.substr(0, pos); result_container.push_back(token); str_copy.erase(0, pos + 1U); } result_container.push_back(str_copy); return result_container; }