[find()]finding substring

PHOTO EMBED

Tue May 21 2024 07:50:26 GMT+0000 (Coordinated Universal Time)

Saved by @ayushg103 #c++

if(str.find(goal) != string::npos)
           {return true;}
           else{return false;}
content_copyCOPY

find() returns index of first element of substring. if substring is not present it returns string::npos