Thursday, December 4, 2014

Cocos2D-X: Substring

It seems like the best way is to convert to a std::string first and use its substr function, so e.g. from a Cocos2D-X String object:
cocos2dxString->_string.substr(pos,len);

Note: for Cocos2D-X 3.0 and above

Reference: http://www.cplusplus.com/reference/string/string/substr/

No comments:

Post a Comment