#include#include int main() { QString str = "Hello World!"; str.chop(1); // remove the last character qDebug() << str; // prints "Hello World" return 0; }
#includeThe `chop` function is part of the Qt Core library, which is included in the Qt SDK.#include int main() { QString str = "Hello World!"; str.chop(6); // remove the last 6 characters qDebug() << str; // prints "Hello" return 0; }