编辑代码

#include <iostream>
#include <string>
using namespace std;
int main() {
    //string 测试 
    string lowercase("Harrylin");
    int pos1 = lowercase.find("harry");
    int pos2 = lowercase.find("Harry");
	cout << "输出测试结果:" << endl;
    cout << pos1 << "\n" << pos2<< endl;
    //复杂搜索:查找任意字符
    string numbers("012345");
    string name("r6d5");
    int pos3 = name.find_first_of(numbers);
    cout<< "查找任意字符结果:"<< endl;
    cout<< pos3 << endl;
	//测试string的数值转换
    int num = 0;
    string s1 = "6e5"; 
    num = stoi(s1);
    cout<< "数值转换结果:"<< num<< endl;
    return 0;

}