wxString有没有直接提供分割字符串的方法? Topic is solved
-
- Earned some good credits
- Posts: 103
- Joined: Thu Apr 03, 2008 5:35 am
- Location: China
- Contact:
wxString有没有直接提供分割字符串的方法?
我看了一下文档,好像没有找到。如果没有就得自己写了
怎么分割法?
分割成两个子串?
分割成两个子串?
In fascination of creating worlds by words, and in pursuit of words behind the world.
On Github: http://utensil.github.com
Technical Blog in Chinese: http://utensil.iteye.com/
On Github: http://utensil.github.com
Technical Blog in Chinese: http://utensil.iteye.com/
如果你的字符串本来包括 '|'字符,你可用wxStringTokenizer
没有的话,至少多次使用wxString::Left()和wxString::Right()可以完成这个任务。
-Utensil
Code: Select all
wxStringTokenizer tkz(wxT("abcdef|efgsad|asdfa|asefas|asdfasd"), wxT("|"));
while ( tkz.HasMoreTokens() )
{
wxString token = tkz.GetNextToken();
// process token here
}
-Utensil
In fascination of creating worlds by words, and in pursuit of words behind the world.
On Github: http://utensil.github.com
Technical Blog in Chinese: http://utensil.iteye.com/
On Github: http://utensil.github.com
Technical Blog in Chinese: http://utensil.iteye.com/