QString str = "Hello world!"; str.insert(5, "beautiful "); // str is now "Hello beautiful world!"
QString str = "12345"; str.insert(2, '6'); // str is now "126345"In this example, a `char` value is inserted into the `QString` object at index position 2, resulting in the new string "126345". The `insert` function is part of the `Qt Core` package library.