Add CString::StartsWith and CString::EndsWith

This commit is contained in:
uu1101
2014-02-09 19:45:09 +01:00
parent 95cfc2228f
commit 7a9ce630ef
2 changed files with 19 additions and 0 deletions

View File

@@ -1092,6 +1092,14 @@ bool CString::TrimSuffix(const CString& sSuffix) {
}
}
bool CString::StartsWith(const CString& sPrefix) const {
return Left(sPrefix.length()).Equals(sPrefix);
}
bool CString::EndsWith(const CString& sSuffix) const {
return Right(sSuffix.length()).Equals(sSuffix);
}
CString CString::TrimPrefix_n(const CString& sPrefix) const {
CString sRet = *this;