2014-02-17 69 views
0

我是C++/CLI的新手,並試圖用多個分隔符分割System::String^使用C++/CLI分割系統::字符串^與多個分隔符

System::String^ = 65 kb (65,546 bytes) 
Split 
System::String^ = 65546 

我發現這個代碼,那將是偉大的,但它僅適用於std::string,我不能轉換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()); 
} 

關於我該怎麼做的任何想法?

+2

是[this](http://stackoverflow.com/questions/7742919/how-to-use-systemstringsplit-with-a-split-of-three-characters?rq= 1)有幫助嗎? –

回答