find函数可在已知字符串中查找子串
#include#include using namespace std; int main() { string s1 = "Rey Dennis Steckler"; string s2 = "Dennis"; string s3 = "Ed Wood"; int f; f = s1.find(s2); if(f < s1.length()) cout<<"Found at index: "<
find函数可在已知字符串中查找子串
#include#include using namespace std; int main() { string s1 = "Rey Dennis Steckler"; string s2 = "Dennis"; string s3 = "Ed Wood"; int f; f = s1.find(s2); if(f < s1.length()) cout<<"Found at index: "<