mirror of
https://github.com/znc/znc.git
synced 2026-06-26 13:01:44 +02:00
Add CString::Contains() for convenience
This is more convenient and readable than comparing Find() to npos,
which is a common task:
$ git grep "find(" | grep "npos" | wc -l
49
This commit is contained in:
@@ -1116,6 +1116,10 @@ bool CString::EndsWith(const CString& sSuffix, CaseSensitivity cs) const {
|
||||
return Right(sSuffix.length()).Equals(sSuffix, cs);
|
||||
}
|
||||
|
||||
bool CString::Contains(const CString& s, CaseSensitivity cs) const {
|
||||
return Find(s, cs) != npos;
|
||||
}
|
||||
|
||||
|
||||
CString CString::TrimPrefix_n(const CString& sPrefix) const {
|
||||
CString sRet = *this;
|
||||
|
||||
Reference in New Issue
Block a user