From: Vadim Zeitlin Date: Tue, 26 Jan 1999 16:08:09 +0000 (+0000) Subject: Added Upper() and Lower() - return the copy of the string converted to upper X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c84c52de6f534df50dc6348b839c98029fa3f8ee Added Upper() and Lower() - return the copy of the string converted to upper or lower case (unlike MakeXXX() counterparts which change the string itself) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1491 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/string.h b/include/wx/string.h index 1073bbcfe8..f3c3c00111 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -403,7 +403,7 @@ public: wxString& operator<<(float f); // insert a double into string wxString& operator<<(double d); - + // string comparison // case-sensitive comparison: return 0 if =, +1 if > or -1 if < int Cmp(const char *psz) const { return strcmp(c_str(), psz); } @@ -441,14 +441,18 @@ public: wxString AfterLast(char ch) const; // for compatibility only, use more explicitly named functions above - wxString Before(char ch) const { return BeforeLast(ch); } - wxString After(char ch) const { return AfterFirst(ch); } + wxString Before(char ch) const { return BeforeLast(ch); } + wxString After(char ch) const { return AfterFirst(ch); } // case conversion - // convert to upper case, return the string itself + // convert to upper case in place, return the string itself wxString& MakeUpper(); - // convert to lower case, return the string itself + // convert to upper case, return the copy of the string + wxString Upper() const { wxString s(*this); return s.MakeUpper(); } + // convert to lower case in place, return the string itself wxString& MakeLower(); + // convert to lower case, return the copy of the string + wxString Lower() const { wxString s(*this); return s.MakeLower(); } // trimming/padding whitespace (either side) and truncating // remove spaces from left or from right (default) side