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++.
you don't need implement a self function. std has provide a function: std::string::find_last_of. for example:
std::string str("c:\windows\winhelp.exe");
unsigned found = str.find_last_of("/\\");
std::cout << " path: " << str.substr(0,found) << '\n';
std::cout << " file: " << str.substr(found+1) << '\n';
path: c:\windows
file: winhelp.exe