开发者

getting substring from ustring

开发者 https://www.devze.com 2023-01-31 02:00 出处:网络
I have a ustring object sourceString wh开发者_JS百科ich is πøˆ∑´®. These string i get from an XML file while parsing it.I have used substr method to get these character string as under.

I have a ustring object sourceString wh开发者_JS百科ich is πøˆ∑´®. These string i get from an XML file while parsing it.I have used substr method to get these character string as under.

Glib::ustring uString = sourceString.substr(5,0); 

But, i could get only null string, how should i a substring from it.


Not sure about how substr() is implemented in your case, however I'd hazard that the order of your parameters is wrong! std::string::substr() takes position first, and then size. In your case size is 0.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号