std::string methods (substr, find)
Në shqip: Metodat e std::string
ShpjegimiSQ
std::string ka metoda si size(), substr(fillimi, gjatësia), find() (kthen std::string::npos kur s'gjen), append(), replace() dhe erase().
EnglishEN
std::string has methods like size(), substr(start, length), find() (returns std::string::npos when not found), append(), replace() and erase().
Si ta mendosh
Si veglat e rrobaqepëses për stofin.
Lexoje në anglisht
Like a tailor's tools for fabric.
Shembull kodicpp
std::string s = "Prishtina";
std::cout << s.substr(0, 4); // Pris
if (s.find("tin") != std::string::npos) std::cout << "U gjet";