CString find the last entry

后端 未结 5 1799
无人共我
无人共我 2021-01-23 08:18

I have two CString s1 and CString s2. I need find the last entry s2 in s1. I can find any metod in CString like in C# LastIndexOf. I am nooby in c++.

5条回答
  •  北海茫月
    2021-01-23 08:48

    There is no CString method to directly address your question. However, you can use a combination of CString::ReverseFind + _tcsncmp to first locate next occurrence of last character of substring and, if found, compare the whole substring from there.

提交回复
热议问题