Мой вариант быдлокода на Qt
QString str1("Hello, ");
QString str2("World!");
for (int i = 0; i < 4; ++i) {
qDebug()<<str1+str2;
qDebug()<<str1+str2.toLower();
qDebug()<<str1.toLower()+str2;
qDebug()<<str1.toLower()+str2.toLower();
if (i == 0) str2.remove("!");
if (i == 1) str1.remove(",");
if (i == 2) str2.append("!");
}
"Hello, World!"
"Hello, world!"
"hello, World!"
"hello, world!"
"Hello, World"
"Hello, world"
"hello, World"
"hello, world"
"Hello World"
"Hello world"
"hello World"
"hello world"
"Hello World!"
"Hello world!"
"hello World!"
"hello world!"