随笔分类 - MySDK之2:字符串处理
CString 逆向查找字符串
摘要: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....
阅读全文
VC 中如何从字符串中分离文件名与路径+路径操作
摘要:#include "stdafx.h"#include "PathStringManager.h"CPathStringOper::CPathStringOper(void){}CPathStringOper::~CPathStringOper(void){}CPathStringOper::GetFolderPathFromFullPath(LPCTSTR lpszFullPath){ // 获取文件路径: // 注意不是“/”以结尾,因为使用过程中加上一个“/”容易,减去一个不容易 CString m_strOriFileName(lpszFullP
阅读全文