git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4892
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
const wxChar* sz, size_t nCount = npos) const;
// substring extraction
- wxString substr(size_t nStart = 0, size_t nLen = npos) const;
+ wxString substr(size_t nStart = 0, size_t nLen = npos) const
+ { return Mid(nStart, nLen); }
#endif // wxSTD_STRING_COMPATIBILITY
};
return npos;
}
-wxString wxString::substr(size_t nStart, size_t nLen) const
-{
- // npos means 'take all'
- if ( nLen == npos )
- nLen = 0;
-
- wxASSERT( nStart + nLen <= Len() );
-
- return wxString(c_str() + nStart, nLen == npos ? 0 : nLen);
-}
-
wxString& wxString::erase(size_t nStart, size_t nLen)
{
wxString strTmp(c_str(), nStart);