Qt:
函数QString::startsWith()
判断一个字符串是否以某个字符串开头。此函数具有 两个参数,第一个参数指定了一个字符串,第二个参数指定是否大小写敏感(默 认情况下,是大小写敏感的),例如:
QString str="Welcome to you! ";
str.startsWith("Welcome",Qt::CaseSensitive); //返回true;
str.startsWith("you",Qt::CaseSensitive); //返回false;
函数QString::contains()
判断一个指定的字符串是否出现过,例如:
QString str=" Welcome to you! ";
str.contains("Welcome",Qt::CaseSensitive); //返回true;
QString("12345").contains("345", Qt::CaseSensitive); //返回true;