#include#include int main() { QCString str = "Hello World"; int pos = str.find("World"); std::cout << pos << std::endl; // Output: 6 return 0; }
#includeIn this example, the find function is used to search the QCString for the substring "Universe" which is not present in the string. Therefore, the function returns -1. The QCString find function is a member of the Qt Core Library.#include int main() { QCString str = "Hello World"; int pos = str.find("Universe"); std::cout << pos << std::endl; // Output: -1 return 0; }