O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Basic string operations

The most basic tasks that involve text strings are the ones where you add or remove characters from the string, concatenate strings, and access the string's content. In this regard, QString offers an interface that is compatible with std::string, but it also goes beyond that, exposing many more useful methods.

Adding data at the beginning or at the end of the string can be done using the prepend() and append() methods. Inserting data in the middle of a string can be done with the insert() method that takes the position of the character where we need to start inserting as its first argument and the actual text as its second argument. All these methods have a couple of overloads that accept different objects that can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required