I'm new to C++/CLI and am trying to split a System::String^
with multiple delimiters.
System::String^ = 65 kb (65,546 bytes)
Split
System::String^ = 65546
I've found this code that would be great but it only works for std::string
and I'm not allowed to convert System::String^
.
std::string s = "65 kb (67,873 bytes)";
std::string delimiter = " (";
size_t pos = 0;
std::string token;
while ((pos = s.find(delimiter)) != std::string::npos) {
token = s.substr(0, pos);
std::cout << token << std::endl;
s.erase(0, pos + delimiter.length());
}
Any ideas on how I would do this?