wxString::substr() bug fixed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4892 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -859,7 +859,8 @@ public:
|
|||||||
const wxChar* sz, size_t nCount = npos) const;
|
const wxChar* sz, size_t nCount = npos) const;
|
||||||
|
|
||||||
// substring extraction
|
// 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
|
#endif // wxSTD_STRING_COMPATIBILITY
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1643,17 +1643,6 @@ size_t wxString::find_last_not_of(wxChar ch, size_t nStart) const
|
|||||||
return npos;
|
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& wxString::erase(size_t nStart, size_t nLen)
|
||||||
{
|
{
|
||||||
wxString strTmp(c_str(), nStart);
|
wxString strTmp(c_str(), nStart);
|
||||||
|
Reference in New Issue
Block a user