CString::Starts/EndsWith(): allow specifying case sensitivity

This commit is contained in:
J-P Nurmi
2014-09-29 16:16:03 +02:00
parent e86f43d841
commit 65f739980d
3 changed files with 30 additions and 6 deletions
+6 -2
View File
@@ -491,14 +491,18 @@ public:
/** Check whether the string starts with a given prefix.
* @param sPrefix The prefix.
* @param cs CaseSensitive if you want the comparision to be case
* sensitive, CaseInsensitive (default) otherwise.
* @return True if the string starts with prefix, false otherwise.
*/
bool StartsWith(const CString& sPrefix) const;
bool StartsWith(const CString& sPrefix, CaseSensitivity cs = CaseInsensitive) const;
/** Check whether the string ends with a given suffix.
* @param sSuffix The suffix.
* @param cs CaseSensitive if you want the comparision to be case
* sensitive, CaseInsensitive (default) otherwise.
* @return True if the string ends with suffix, false otherwise.
*/
bool EndsWith(const CString& sSuffix) const;
bool EndsWith(const CString& sSuffix, CaseSensitivity cs = CaseInsensitive) const;
/** Remove characters from the beginning of this string.
* @param uLen The number of characters to remove.