QString Snippets: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
AutoSpider (talk | contribs) (Add "cleanup" tag) |
||
Line 1: | Line 1: | ||
{{Cleanup | reason=Auto-imported from ExpressionEngine.}} | |||
note: This page will contain code snippets of all QString functions | note: This page will contain code snippets of all QString functions | ||
Revision as of 16:23, 3 March 2015
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine. Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean. |
note: This page will contain code snippets of all QString functions
QString::endsWith()
Returns true if the string ends with s; otherwise returns false.
- include <QTextStream>
- include <QString>
int main()
{
QTextStream out(stdout);
QString *string = new QString("example-0.0.1.tar.gz");
if (string->endsWith(".tar.gz") == true) {
out << "True\n";
} else {
out << "False\n";
}
}