맨체스터 사는 개발자

[C++] wstring 구분자로 split 본문

개발/C++

[C++] wstring 구분자로 split

aaamy91 2021. 8. 17. 06:59

https://stackoverflow.com/questions/36812132/splitting-stdwstring-into-stdvector

 

Splitting std::wstring into std::vector

This question shows how to split a string into a vector using a single character delimeter. Question: Right way to split an std::string into a vector However, applying this technique to wstring i...

stackoverflow.com

 

std::wstring str = L"the;quick;brown;fox", temp;
std::vector<std::wstring> parts;
std::wstringstream wss(str);
while(std::getline(wss, temp, L';'))
    parts.push_back(temp);