QString Snippets: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
note: This page will contain code snippets of all QString functions | note: This page will contain code snippets of all QString functions | ||
'''QString::endsWith()''' | '''QString::endsWith()''' | ||
Returns true if the string ends with s; otherwise returns false. | |||
<code> | |||
#include <QTextStream> | |||
#include <QString> | |||
int main() | int main() | ||
{ | |||
QTextStream out(stdout); | |||
QString *string = new QString("example-0.0.1.tar.gz"); | |||
if (string- | if (string->endsWith(".tar.gz") == true) { | ||
out << "True\n"; | |||
} else { | |||
out << "False\n"; | |||
} | |||
} |
Revision as of 12:43, 25 February 2015
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";
}
}