Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if CString contains specific Text MFC [closed]

Tags:

c++

mfc

I want to check if a String contains a specific Text. Something like this

CString a;
CString b;
if (a.Find (b))
{
    String a contains String b
}

Can anyone help me? Im working with mfc

like image 832
user2675121 Avatar asked Dec 03 '13 08:12

user2675121


1 Answers

If you change your if statement to

if (a.Find (b) != -1)

then you got what you want.

like image 98
Werner Henze Avatar answered Oct 30 '22 05:10

Werner Henze