]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
fix errors due to missing wxPrintf() declaration in STL build
[wxWidgets.git] / src / common / string.cpp
index 595caf71257daa6259c51b4c006b22304f15a879..5729c48c65bdf035423de096875d19c46fa9846e 100644 (file)
@@ -1276,7 +1276,7 @@ wxString wxString::Right(size_t nCount) const
   return dest;
 }
 
-// get all characters after the last occurence of ch
+// get all characters after the last occurrence of ch
 // (returns the whole string if ch not found)
 wxString wxString::AfterLast(wxUniChar ch) const
 {
@@ -1285,7 +1285,7 @@ wxString wxString::AfterLast(wxUniChar ch) const
   if ( iPos == wxNOT_FOUND )
     str = *this;
   else
-    str = wx_str() + iPos + 1;
+    str.assign(*this, iPos + 1, npos);
 
   return str;
 }
@@ -1303,16 +1303,17 @@ wxString wxString::Left(size_t nCount) const
   return dest;
 }
 
-// get all characters before the first occurence of ch
+// get all characters before the first occurrence of ch
 // (returns the whole string if ch not found)
 wxString wxString::BeforeFirst(wxUniChar ch) const
 {
   int iPos = Find(ch);
-  if ( iPos == wxNOT_FOUND ) iPos = length();
+  if ( iPos == wxNOT_FOUND )
+      iPos = length();
   return wxString(*this, 0, iPos);
 }
 
-/// get all characters before the last occurence of ch
+/// get all characters before the last occurrence of ch
 /// (returns empty string if ch not found)
 wxString wxString::BeforeLast(wxUniChar ch) const
 {
@@ -1324,19 +1325,19 @@ wxString wxString::BeforeLast(wxUniChar ch) const
   return str;
 }
 
-/// get all characters after the first occurence of ch
+/// get all characters after the first occurrence of ch
 /// (returns empty string if ch not found)
 wxString wxString::AfterFirst(wxUniChar ch) const
 {
   wxString str;
   int iPos = Find(ch);
   if ( iPos != wxNOT_FOUND )
-    str = wx_str() + iPos + 1;
+      str.assign(*this, iPos + 1, npos);
 
   return str;
 }
 
-// replace first (or all) occurences of some substring with another one
+// replace first (or all) occurrences of some substring with another one
 size_t wxString::Replace(const wxString& strOld,
                          const wxString& strNew, bool bReplaceAll)
 {