嗨,我想将字符从一点打印到另一点,例如
string str = "what is o and o this "; //I want to print all the
//characters [ O and O ]
string temp1;
int loc1, loc2;
loc1 = str.find_first_not_of('o');
loc2 = str.find_last_not_of('o');
temp1 = str.substr(loc1, loc2);
cout << temp1 << endl; //this prints out entire string
谁能帮我??谢谢大家的帮助!!