C++????????????
???????????? ???????[ 2016/9/21 9:55:13 ] ????????????? C++
??????8??size??length:?????????????
??????????????????????C?????в????????????β????????????????????
????// size()?? length():?????????????
????string stringCount = "chenyufeng";
????cout << "stringSize = " << stringCount.size() << endl;
????cout << "stringLength = " << stringCount.length() << endl;
???????????????????10.
??????9??empty???ж????????????
// empty():?ж????????????
string stringIsEmpty = "";
string stringNotEmpty = "chen";
if (stringIsEmpty.empty())
{
cout << "stringIsEmpty == empty" << endl;
}
else
{
cout << "stringIsEmpty != empty" << endl;
}
if (stringNotEmpty.empty())
{
cout << "stringNotEmpty == empty" << endl;
}
else
{
cout << "stringNotEmpty != empty" << endl;
}
??????10??????????????????
????// ???????stream
????cout << "??????????????"<<endl;
????string stringInput;
????cin >> stringInput;
????cout << "stringInput = " << stringInput << endl;
????????????????????C++????????????????????????????????????????????????????
??????11??max_size:?????????????????
????// max_size:
????string stringMaxSize;
????cout << "stringMaxSize = " << stringMaxSize.max_size() << endl;
?????????????18446744073709551599 ?????????????????????????????????
??????12??[]?? at :??????????
????// []??at() :?????
????string stringAt = "chenyufeng";
????cout << "stringAt[3] = " <<stringAt[3] << endl;
????cout << "stringAt.at(3) = " << stringAt.at(3) << endl;
????stringAt[3] = '6';
????stringAt.at(5) = '9';
????cout << "stringAt = " << stringAt << endl;
????????????????????????в?????????±???д????????????????????????
??????13??compare:??????????????0??1 ??-1??
????// compare()
????string stringCompare = "chenyufeng";
????int aaa = stringCompare.compare("chen"); // > 0
????int bbb = stringCompare.compare("chenyufeng"); // == 0
????int ccc = stringCompare.compare("done"); // < 0
????cout << "aaa = " << aaa << ";bbb = " << bbb << ";ccc = " << ccc << endl;
??????14??substr:????????
????// substr
????string stringSubstr = "chenyufeng";
????// ???????4?????3?????
????cout << "stringSubstr.substr(4??3) = " << stringSubstr.substr(4??3) << endl;
????// ???????4????????????
????cout << "stringSubstr.substr(4) = " <<stringSubstr.substr(4) << endl;
????// ???????
????cout << "stringSubstr.substr() = " <<stringSubstr.substr() << endl;
??????15??find????????????
????// find
????string stringFind = "chenyufeng";
????stringFind.find('n');
????cout << "stringFind.find('n') = " << stringFind.find('n') << endl;
????cout << "stringFind.find_first_of('e') = " << stringFind.find_first_of('e') << endl;
????cout << "stringFind.find_last_of('e') = " << stringFind.find_last_of('e') << endl;
???????find???????????????????γ?????±?index??find_first_of??find_last_of?????????κ????γ???????????index??
????????15??C++?е?????????????????????????????????в????????????????????м???????string??????STL?е???????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??C++????????????C++ lvalue??rvalueC++11????????C++???????????????C++?е?????????????????C++?????????C++???Windows????λ??C/C++???????????????????JAVA??C??C++??????????c++??python???????????????????????????????C++???????C++?е????????C++????????????????C++ ???????????????C++?????????????????????C++????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????