如何将一个bstr分成两个bstr

编程入门 行业动态 更新时间:2024-10-23 13:35:32
本文介绍了如何将一个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

本文发布于:2023-11-26 00:42:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631973.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何将   两个   bstr

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!