if ( iPos == NOT_FOUND )
str = *this;
else
- str = c_str() + iPos;
+ str = c_str() + iPos + 1;
return str;
}
wxString str;
int iPos = Find(ch, TRUE);
if ( iPos != NOT_FOUND && iPos != 0 )
- str = wxString(c_str(), iPos - 1);
+ str = wxString(c_str(), iPos);
return str;
}
}
// ---------------------------------------------------------------------------
-// formatted output
+// formatted input/output
// ---------------------------------------------------------------------------
int wxString::Printf(const char *pszFormat, ...)
{
int wxString::PrintfV(const char* pszFormat, va_list argptr)
{
- static char s_szScratch[1024];
+ static char s_szScratch[1024]; // @@@@ shouldn't use fixed-size buffer!
int iLen = vsprintf(s_szScratch, pszFormat, argptr);
AllocBeforeWrite(iLen);
return iLen;
}
+int wxString::Scanf(const char *pszFormat, ...) const
+{
+ va_list argptr;
+ va_start(argptr, pszFormat);
+
+ int iLen = ScanfV(pszFormat, argptr);
+
+ va_end(argptr);
+
+ return iLen;
+}
+
+int wxString::ScanfV(const char *pszFormat, va_list argptr) const
+{
+ return vsscanf(c_str(), pszFormat, argptr);
+}
+
// ---------------------------------------------------------------------------
// standard C++ library string functions
// ---------------------------------------------------------------------------