首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > C/C++/VC++ > VC++ 依据特定字符拆分字符串

VC++ 依据特定字符拆分字符串

  • 资源大小:2.12 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: VC++,c++

资 源 简 介

int CFileFun::SplitCString(CString strIn, CStringArray& strAryRe, LPCTSTR lpstr){ASSERT(lpstr);strAryRe.RemoveAll();int len1 = strIn.GetLength();int len2 = _tcslen(lpstr);if (0 == len1 || 0 == len2){return 0;}int pos1 = 0, pos2 = 0;while ((pos2 = strIn.Find(lpstr, pos1)) != -1){strAryRe.Add(strIn.Mid(pos1, pos2 - pos1));pos1 = pos2 + len2;}//加上最一个...if (len1 > pos1 + 1){strAryRe.Add(strIn.Mid(pos1));}return strAryRe.GetSize();}

文 件 列 表

FileFun.cpp
VIP VIP
0.170524s