carl2380

 AllInput 待查找的完整字符串,key 被查找的子字符串

  {
CString AllInput = GetAllTxt();
CString key = _T("/r/n")+strGuestName;

CString strLastInput;
CString stemp = AllInput;
int pos = stemp.ReverseFind(\'/r\');
while (pos>0)
{
CString sSub = stemp.Mid(pos); // 获得最后1行字符串
if (sSub.Find(key)>=0)
{
// 最后1行字符串找到匹配字段
strLastInput = AllInput.Mid(pos);
break;
}
else
{
// 在最后1行字符串(pos右边)没有找到匹配字段,把右边部分截掉,用ReverseFind继续向左查找匹配字段
stemp = stemp.Left(pos);
pos = stemp.ReverseFind(\'/r\');
}
}
}



分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-11-07
  • 2021-12-12
  • 2021-11-18
  • 2021-10-27
  • 2021-10-09
  • 2022-03-06
  • 2022-01-12
猜你喜欢
  • 2021-12-12
  • 2021-09-11
  • 2022-12-23
  • 2021-12-27
  • 2021-12-12
  • 2022-12-23
相关资源
相似解决方案