QString str = " hel lo! ";
//1.移除两端的空白字符
QString str1 = str.trimmed();
//2.移除两端的空白字符,使用单个空格字符代替字符串中出现的空白字符
QString str12 = str.simplified();
//3.是否以“ he”开头
bool OK = str.startsWith(" he");//是否以“ he”开头,返回true
//4.是否以“ ”结尾
bool OK = str.endsWith(" ");//是否以“ ”结尾,false
//5.是否包含“lo”,
bool OK = str.contains(“lo”);//是否包含“lo”,返回true
int t = QString::localeAwareCompare(“A”,“A”);
t = QString::compare(“A”,“a”);
QString numTest;
numTest.setNum(20);
//8.char*转QString
char* cstr = new char[10];
QString::fromLocal8Bit(cstr);