#include<iostream>
#include<cstring>
using namespace std;
int main()
{
string s="welcome to my world";
char str[10];
s.copy(str,s.length());
cout<<str<<endl;
cout<<s.find("to")<<endl;
cout<<s.find("is")<<endl;
cout<<s.rfind("o")<<endl;
cout<<s.find_first_of('o');
cout<<s.find_last_of('o');
return 0;
}
No comments:
Post a Comment