MFC 查找字符串中某一字符第一次出现的位置

2025-05-06 06:27:16
推荐回答(1个)
回答1:

既然用了CString,就不要在转换char*了,很可能出现双字节不兼容问题。
int pos = string.Find(_T("."));
if(pos<0) //没有找到