+ int Find(wxUniChar ch, bool fromEnd = false) const;
+
+ /**
+ Searches for the given string @a sub.
+ Returns the starting position or @c wxNOT_FOUND if not found.
+ */
+ int Find(const wxString& sub) const;
+
+ /**
+ Same as Find().
+
+ This is a wxWidgets 1.xx compatibility function;
+ you should not use it in new code.
+ */
+ int First(wxUniChar ch) const;
+
+ /**
+ Same as Find().
+
+ This is a wxWidgets 1.xx compatibility function;
+ you should not use it in new code.
+ */
+ int First(const wxString& str) const;
+
+ /**
+ Replace first (or all) occurrences of substring with another one.
+
+ @param strOld
+ The string to search for replacing.
+ @param strNew
+ The substitution string.
+ @param replaceAll
+ If @true a global replace will be done (default), otherwise only the
+ first occurrence will be replaced.
+
+ Returns the number of replacements made.
+ */
+ size_t Replace(const wxString& strOld, const wxString& strNew,
+ bool replaceAll = true);
+
+ //@}
+
+
+
+ /**
+ @member_group_name{numconv, Conversion to numbers}
+
+ The string provides functions for conversion to signed and unsigned integer and
+ floating point numbers.
+
+ All functions take a pointer to the variable to put the numeric value
+ in and return @true if the @b entire string could be converted to a
+ number. Notice if there is a valid number in the beginning of the
+ string, it is returned in the output parameter even if the function
+ returns @false because there is more text following it.
+ */
+ //@{
+
+ /**
+ Attempts to convert the string to a floating point number.
+
+ Returns @true on success (the number is stored in the location pointed to by
+ @a val) or @false if the string does not represent such number (the value of
+ @a val may still be modified in this case).
+
+ Note that unlike ToCDouble() this function uses a localized version of
+ @c wxStrtod() and thus needs as decimal point (and thousands separator) the
+ locale-specific decimal point. Thus you should use this function only when
+ you are sure that this string contains a floating point number formatted with
+ the rules of the locale currently in use (see wxLocale).
+
+ Also notice that even this function is locale-specific it does not
+ support strings with thousands separators in them, even if the current
+ locale uses digits grouping. You may use wxNumberFormatter::FromString()
+ to parse such strings.
+
+ Please refer to the documentation of the standard function @c strtod()
+ for more details about the supported syntax.
+
+ @see ToCDouble(), ToLong(), ToULong()
+ */
+ bool ToDouble(double* val) const;
+
+ /**
+ Variant of ToDouble() always working in "C" locale.
+
+ Works like ToDouble() but unlike it this function expects the floating point
+ number to be formatted always with the rules dictated by the "C" locale
+ (in particular, the decimal point must be a dot), independently from the
+ current application-wide locale (see wxLocale).
+
+ @see ToDouble(), ToLong(), ToULong()
+ */
+ bool ToCDouble(double* val) const;
+
+ /**
+ Attempts to convert the string to a signed integer in base @a base.
+
+ Returns @true on success in which case the number is stored in the location
+ pointed to by @a val or @false if the string does not represent a
+ valid number in the given base (the value of @a val may still be
+ modified in this case).
+
+ The value of @a base must be comprised between 2 and 36, inclusive, or
+ be a special value 0 which means that the usual rules of @c C numbers are
+ applied: if the number starts with @c 0x it is considered to be in base
+ 16, if it starts with @c 0 - in base 8 and in base 10 otherwise. Note
+ that you may not want to specify the base 0 if you are parsing the numbers
+ which may have leading zeroes as they can yield unexpected (to the user not
+ familiar with C) results.
+
+ Note that unlike ToCLong() this function uses a localized version of
+ @c wxStrtol(). Thus you should use this function only when you are sure
+ that this string contains an integer number formatted with
+ the rules of the locale currently in use (see wxLocale).
+
+ As with ToDouble(), this function does not support strings containing
+ thousands separators even if the current locale uses digits grouping.
+ You may use wxNumberFormatter::FromString() to parse such strings.
+
+ Please refer to the documentation of the standard function @c strtol()
+ for more details about the supported syntax.
+
+ @see ToCDouble(), ToDouble(), ToULong()
+ */
+ bool ToLong(long* val, int base = 10) const;
+
+ /**
+ Variant of ToLong() always working in "C" locale.
+
+ Works like ToLong() but unlike it this function expects the integer
+ number to be formatted always with the rules dictated by the "C" locale,
+ independently from the current application-wide locale (see wxLocale).
+
+ @see ToDouble(), ToLong(), ToULong()
+ */
+ bool ToCLong(long* val, int base = 10) const;
+
+ /**
+ This is exactly the same as ToLong() but works with 64 bit integer numbers.
+
+ Notice that currently it doesn't work (always returns @false) if parsing of 64
+ bit numbers is not supported by the underlying C run-time library. Compilers
+ with C99 support and Microsoft Visual C++ version 7 and higher do support this.
+
+ @see ToLong(), ToULongLong()
+ */
+ bool ToLongLong(wxLongLong_t* val, int base = 10) const;
+
+ /**
+ Attempts to convert the string to an unsigned integer in base @a base.
+
+ Returns @true on success in which case the number is stored in the
+ location pointed to by @a val or @false if the string does not
+ represent a valid number in the given base (the value of @a val may
+ still be modified in this case).
+
+ Please notice that this function behaves in the same way as the standard
+ @c strtoul() and so it simply converts negative numbers to unsigned
+ representation instead of rejecting them (e.g. -1 is returned as @c ULONG_MAX).
+
+ See ToLong() for the more detailed description of the @a base parameter
+ (and of the locale-specific behaviour of this function).
+
+ @see ToCULong(), ToDouble(), ToLong()
+ */
+ bool ToULong(unsigned long* val, int base = 10) const;
+
+ /**
+ Variant of ToULong() always working in "C" locale.
+
+ Works like ToULong() but unlike it this function expects the integer
+ number to be formatted always with the rules dictated by the "C" locale,
+ independently from the current application-wide locale (see wxLocale).
+
+ @see ToDouble(), ToLong(), ToULong()
+ */
+ bool ToCULong(unsigned long* val, int base = 10) const;
+
+ /**
+ This is exactly the same as ToULong() but works with 64 bit integer
+ numbers.
+
+ Please see ToLongLong() for additional remarks.
+ */
+ bool ToULongLong(wxULongLong_t* val, int base = 10) const;
+
+ //@}
+
+
+ /**
+ @member_group_name{fmt, Formatting and printing}
+
+ Both formatted versions (Printf/() and stream-like insertion operators
+ exist (for basic types only).
+
+ See also the static Format() and FormatV() functions.
+ */
+ //@{
+
+ /**
+ Similar to the standard function @e sprintf(). Returns the number of
+ characters written, or an integer less than zero on error.
+ Note that if @c wxUSE_PRINTF_POS_PARAMS is set to 1, then this function supports
+ Unix98-style positional parameters:
+
+ @code
+ wxString str;
+
+ str.Printf(wxT("%d %d %d"), 1, 2, 3);
+ // str now contains "1 2 3"
+
+ str.Printf(wxT("%2$d %3$d %1$d"), 1, 2, 3);
+ // str now contains "2 3 1"
+ @endcode
+
+ @note This function will use a safe version of @e vsprintf() (usually called
+ @e vsnprintf()) whenever available to always allocate the buffer of correct
+ size. Unfortunately, this function is not available on all platforms and the
+ dangerous @e vsprintf() will be used then which may lead to buffer overflows.
+ */
+ int Printf(const wxString& pszFormat, ...);
+
+ /**
+ Similar to vprintf. Returns the number of characters written, or an integer
+ less than zero
+ on error.
+ */
+ int PrintfV(const wxString& pszFormat, va_list argPtr);
+
+ //@}
+
+
+ /**
+ @member_group_name{mem, Memory management}
+
+ The following are "advanced" functions and they will be needed rarely.
+ Alloc() and Shrink() are only interesting for optimization purposes.
+ wxStringBuffer and wxStringBufferLength classes may be very useful when working
+ with some external API which requires the caller to provide a writable buffer.
+
+ See also the reserve() and resize() STL-like functions.
+ */
+ //@{
+
+ /**
+ Preallocate enough space for wxString to store @a nLen characters.
+
+ Please note that this method does the same thing as the standard
+ reserve() one and shouldn't be used in new code.
+
+ This function may be used to increase speed when the string is
+ constructed by repeated concatenation as in
+
+ @code
+ // delete all vowels from the string
+ wxString DeleteAllVowels(const wxString& original)
+ {
+ wxString result;
+
+ size_t len = original.length();
+
+ result.Alloc(len);
+
+ for ( size_t n = 0; n < len; n++ )
+ {
+ if ( strchr("aeuio", tolower(original[n])) == NULL )
+ result += original[n];
+ }
+
+ return result;
+ }
+ @endcode
+
+ because it will avoid the need to reallocate string memory many times
+ (in case of long strings). Note that it does not set the maximal length
+ of a string -- it will still expand if more than @a nLen characters are
+ stored in it. Also, it does not truncate the existing string (use
+ Truncate() for this) even if its current length is greater than @a nLen.
+
+ @return @true if memory was successfully allocated, @false otherwise.
+ */
+ bool Alloc(size_t nLen);
+
+ /**
+ Minimizes the string's memory. This can be useful after a call to
+ Alloc() if too much memory were preallocated.
+ */
+ bool Shrink();
+
+ /**
+ Returns a deep copy of the string.
+
+ That is, the returned string is guaranteed to not share data with this
+ string when using reference-counted wxString implementation.
+
+ This method is primarily useful for passing strings between threads
+ (because wxString is not thread-safe). Unlike creating a copy using
+ @c wxString(c_str()), Clone() handles embedded NULs correctly.
+
+ @since 2.9.0
+ */
+ wxString Clone() const;
+
+ /**
+ Empties the string and frees memory occupied by it.
+
+ @see Empty()
+ */
+ void Clear();
+