### Max split Python's split method takes a maxsplit argument which limits the number of splits, so that, for example, `"the quick brown fox".split(" ",2)` would result in `["the","quick","brown fox"]`. Qt does not have such a feature, though it is easily implemented. This snippet based on answer from https://stackoverflow.com/questions/18343253/qt-qstring-maxsplit-argument ```plaintext QStringList split_with_max(QString& str, QString& sep, int maxSplit=-1) { if( maxSplit < 0 ) return str.split(sep); if( maxSplit == 0 ) return QStringList(str); QStringList list = str.split(sep).mid(0, maxSplit); QString remainingStr = str.section(sep, maxSplit); list << remainingStr; return list; } ``` ### Printing to console ```plaintext QTextStream& qStdOut() { static QTextStream ts( stdout ); return ts; } QTextStream& qStdErr() { static QTextStream ts( stderr ); return ts; } int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QDir dir; qStdOut() << dir.currentPath() << "\n"; qStdOut().flush(); } ``` as an example of this and `QRegularExpression`, see PoorMansGrepV1.