本文介绍了如何将一个bstr分成两个bstr的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我遇到需要使用定界符将bstr分成两个单独的bstr的情况. 是否有可用的API/宏
I have scenario where i need to split the bstr into two seperate bstr using a delimiter. Is there any API/macro available
推荐答案您可以使用其他字符串类提供的方法,例如std::wstring. 例如(使用空格作为分隔符): You may use the methods provided by another string class, for instance std::wstring. e.g. (using a blank as delimiter): bstr_t b = bstr_t(L"Hi folks"); wstring w = b; wstring::size_type pos = w.find(L' '); bstr_t b1 = w.substr(0, pos).c_str(); bstr_t b2 = w.substr(pos+1).c_str();
我认为此链接将为此提供一些良好的信息,并引导您进入分析服务公司. www.johndcook/cplusplus_strings.html [ ^ ] 祝你好运! I think this link will provide some good information on this and will lead you to the anser. www.johndcook/cplusplus_strings.html[^] Good luck!
更多推荐
如何将一个bstr分成两个bstr
发布评论