• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
梦想的天空分外蓝!
展望未来 超越梦想
博客园    首页       联系   管理    订阅  订阅
2012年10月4日
[摘]C/C++实现js的split函数功能
摘要: 今天在网上找了一下,发觉有比较多的方法,现在列出来,需要的朋友可以参考一下。功能最丰富的就是第一种方法了:1 vector<string> Split(const string& s,const string& match,bool removeEmpty=false,bool fullMatch=false) 2 //参数s为需要肢解的字符串 3 //参数match为肢解匹配字符串 4 //参数removeEmpty为是否删除空字符 5 //参数fullMatch为是否只保留全匹配的字符串 6 7 下面为代码区: 8 #include <string> 阅读全文
posted @ 2012-10-04 23:28 Kiven 阅读(401) 评论(0) 推荐(0)
char*与System::String^的相互转换
摘要: #include "stdafx.h" using namespace System; //这个命名空间如果缺的话,IntPtr这个无法识别int main(array<System::String ^> ^args) { char* ch1 = "this is chars "; //将char*转换为System::String^ String^ str1= System::Runtime::InteropServices::Marshal::PtrToStringAnsi((IntPtr)ch1); //System::String^转 阅读全文
posted @ 2012-10-04 16:48 Kiven 阅读(16698) 评论(0) 推荐(2)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3