Splits the given string using the given separators into parts. @param p_String String to split. @param p_Separators Separators to use for splitting. @return String parts.
| 78 | // @return String parts. |
| 79 | // |
| 80 | PCC::WStringV StringUtils::Split(std::wstring p_String, |
| 81 | const std::wstring& p_Separators) |
| 82 | { |
| 83 | PCC::WStringV vParts; |
| 84 | if (!p_String.empty()) { |
| 85 | wchar_t* context = nullptr; |
| 86 | wchar_t* pCurToken = ::wcstok_s(&*p_String.begin(), p_Separators.c_str(), &context); |
| 87 | while (pCurToken != nullptr) { |
| 88 | vParts.emplace_back(pCurToken); |
| 89 | pCurToken = ::wcstok_s(nullptr, p_Separators.c_str(), &context); |
| 90 | } |
| 91 | } |
| 92 | return vParts; |
| 93 | } |
| 94 | |
| 95 | // |
| 96 | // Splits the given string using the given separator into parts. |
no test coverage detected