Ref T660, utility functions

This commit is contained in:
Klaus Basan
2019-07-10 03:10:17 +02:00
parent e081667bef
commit 445d0eb0f6
4 changed files with 33 additions and 0 deletions

View File

@@ -454,6 +454,16 @@ namespace BlackMisc
return candidate;
}
bool containsAny(const QString &testString, const QStringList &any, Qt::CaseSensitivity cs)
{
if (testString.isEmpty() || any.isEmpty()) { return false; }
for (const QString &a : any)
{
if (testString.contains(a, cs)) { return true; }
}
return false;
}
} // ns
//! \endcond