3ds Max C++ API Reference
WStr Class Reference

#include <strclass.h>

+ Inheritance diagram for WStr:

Public Member Functions

 WStr ()
 
 WStr (const wchar_t *wcstr)
 
 WStr (const WStr &ws)
 
 WStr (const MaxSDK::Util::MaxString &ws)
 
 WStr (const MaxSDK::Util::MaxStringCast< WCHAR > &ws)
 
 WStr (const QString &qstring)
 Conversion constructor, from QString. More...
 
 ~WStr ()
 
wchar_t * dataForWrite (size_t nchars=(size_t) -1)
 Returns a pointer to this string which can be written to with up to 'nchars' characters. More...
 
const wchar_t * data () const
 
 operator const wchar_t * () const
 
 operator QString () const
 Conversion operator to QString. More...
 
void Resize (int nchars)
 
int Length () const
 
int length () const
 
int ByteCount () const
 
int LanguageCharacterCount () const
 
size_t AllocatedChars () const
 
bool isNull () const
 
WStroperator= (const WStr &ws)
 
WStroperator= (const MaxSDK::Util::MaxString &mstr)
 
WStroperator= (const wchar_t *wcstr)
 
WStroperator= (const MaxSDK::Util::MaxStringCast< WCHAR > &mstr)
 
WStr operator+ (const WStr &ws) const
 
WStroperator+= (const WStr &ws)
 
WStrAppend (const WStr &ws)
 
WStrappend (const WStr &ws)
 
WStrremove (int pos)
 
WStrremove (int pos, int N)
 
WStr Substr (int start, int nchars) const
 
wchar_t operator[] (int i) const
 Returns the nth character of this string. More...
 
int first (wchar_t c) const
 
int last (wchar_t c) const
 
bool operator== (const WStr &ws) const
 
bool operator== (wchar_t c) const
 
bool operator!= (const WStr &ws) const
 
bool operator!= (wchar_t c) const
 
bool operator< (const WStr &ws) const
 
bool operator<= (const WStr &ws) const
 
bool operator> (const WStr &ws) const
 
bool operator>= (const WStr &ws) const
 
void toUpper ()
 
void toLower ()
 
int printf (const wchar_t *format,...)
 Write a formatted string into this WStr. More...
 
int printf_l (const wchar_t *format, const _locale_t theLocale,...)
 Write a formatted string into this WStr using specified locale. More...
 
int vprintf (const wchar_t *format, va_list args)
 Write a formatted string into this WStr. More...
 
int vprintf_l (const wchar_t *format, const _locale_t theLocale, va_list args)
 Write a formatted string into this WStr specified locale. More...
 
WStr MultiByteCharacterSubString (int firstCharacterIndex, int numberOfMBCharacters) const
 
wchar_t * ToBSTR () const
 
MaxSDK::Util::MaxStringCastCP ToCP (UINT cp, size_t *length=NULL) const
 
MaxSDK::Util::MaxStringCast< char > ToACP (size_t *length=NULL) const
 
MaxSDK::Util::MaxStringCastUTF8 ToUTF8 (size_t *length=NULL) const
 
MaxSDK::Util::MaxStringCast< WCHAR > ToOLESTR (size_t *length=NULL) const
 
MaxSDK::Util::MaxStringCast< WCHAR > ToUTF16 (size_t *length=NULL) const
 
MaxSDK::Util::MaxStringCast< unsigned intToUTF32 (size_t *length=NULL) const
 
MaxSDK::Util::MaxString ToMaxString () const
 
void ToMaxString (MaxSDK::Util::MaxString &) const
 
CStr ToCStr () const
 
WStr ToWStr () const
 
const wchar_t * ToMCHAR (size_t *length=NULL) const
 
WStr ToMSTR () const
 
bool EndsWith (const WStr &s, bool caseSensitive=true)
 Returns true if the string ends with s; otherwise returns false. More...
 
bool EndsWith (wchar_t c, bool caseSensitive=true)
 Returns true if the string ends with c; otherwise returns false. More...
 
bool StartsWith (const WStr &s, bool caseSensitive=true)
 Returns true if the string starts with s; otherwise returns false. More...
 
bool StartsWith (wchar_t c, bool caseSensitive=true)
 Returns true if the string starts with c; otherwise returns false. More...
 
size_t NumberOfLines () const
 Returns the number of line feeds inside a string. More...
 
size_t Replace (const wchar_t *pFind, const wchar_t *pReplaceBy, bool firstOnly=false, size_t startPosition=0)
 Replaces one substring with another in this string. More...
 

Static Public Member Functions

static WStr FromBSTR (const wchar_t *string, size_t length=(size_t) -1)
 
static WStr FromCP (UINT cp, const char *string, size_t length=(size_t) -1)
 
static WStr FromACP (const char *string, size_t length=(size_t) -1)
 
static WStr FromUTF8 (const char *string, size_t length=(size_t) -1)
 
static WStr FromOLESTR (const wchar_t *string, size_t length=(size_t) -1)
 
static WStr FromUTF16 (const wchar_t *string, size_t length=(size_t) -1)
 
static WStr FromUTF32 (const unsigned int *string, size_t length=(size_t) -1)
 
static WStr FromMaxString (MaxSDK::Util::MaxString &string)
 
static WStr FromCStr (const CStr &string)
 
static WStr FromWStr (const WStr &string)
 
static WStr FromMCHAR (const wchar_t *string, size_t length=(size_t) -1)
 
static WStr FromMSTR (const WStr &string)
 
- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

See also
Class CStr, UTF8Str and MaxString, Guidelines for Handling Character Strings.

Description:
A wide character string class. This class uses 16 bits to hold each character. Methods and operators are provided for calculating lengths, concatenation, substring operations, character searching, case conversion, comparison, and formatted writing. All methods are implemented by the system.

OLE file IO requires the wide characters of WStr.
Note
The memory occupied by a WStr object is cannot be larger than 2Gb.

Constructor & Destructor Documentation

◆ WStr() [1/6]

WStr ( )
Remarks
Constructor. The string is set to NULL.

◆ WStr() [2/6]

WStr ( const wchar_t *  wcstr)
Remarks
Constructor. The string is initialized to the string passed.

◆ WStr() [3/6]

WStr ( const WStr ws)
Remarks
Constructor. The string is initialized to the string passed.

◆ WStr() [4/6]

WStr ( const MaxSDK::Util::MaxString ws)
Remarks
Constructor. The string is initialized to the string passed.

◆ WStr() [5/6]

WStr ( const MaxSDK::Util::MaxStringCast< WCHAR > &  ws)
Remarks
Constructor. The string is initialized to the string passed.

◆ WStr() [6/6]

WStr ( const QString &  qstring)

Conversion constructor, from QString.

◆ ~WStr()

~WStr ( )
Remarks
Destructor. The string is deleted.

Member Function Documentation

◆ dataForWrite()

wchar_t* dataForWrite ( size_t  nchars = (size_t) -1)

Returns a pointer to this string which can be written to with up to 'nchars' characters.

Remarks
The terminating null character is not included in nchars, so technically up to nchars+1 characters may be written.
Parameters
ncharsThe minimum number of characters to allocate in the string buffer (excluding the terminating null character). A value of -1 specifies that the existing buffer should be re-used.

◆ data()

const wchar_t* data ( ) const
Remarks
Returns a const pointer to the string. If the string is NULL, a pointer to 0 is returned.

◆ operator const wchar_t *()

operator const wchar_t * ( ) const
Remarks
Returns a const pointer to the string. If the string is NULL, a pointer to 0 is returned.

◆ operator QString()

operator QString ( ) const

Conversion operator to QString.

◆ Resize()

void Resize ( int  nchars)
Remarks
Reallocates the string to contain nchars characters. If the string is enlarged it is padded with blanks.
Parameters:
int nchars

Specifies the new number of characters for the string.

◆ Length()

int Length ( ) const
Remarks
Returns the number of WCHAR that are used to represents this string, including spaces, but excluding the terminal NULL character.

◆ length()

int length ( ) const
inline
Remarks
Returns the number of WCHAR that are used to represents this string, including spaces, but excluding the terminal NULL character.
781 { return Length(); }
int Length() const

◆ ByteCount()

int ByteCount ( ) const
Remarks
Returns the number of bytes used to store the string in memory, including spaces, but excluding the terminating NULL character.

◆ LanguageCharacterCount()

int LanguageCharacterCount ( ) const
Remarks
Returns the number of natural language characters the string is represented on, including spaces, but excluding the terminal NULL character.

This may be equal or less than the amount of WCHAR used to store the string in memory. For example, a chinese character might take two WCHARs. Length() will count the character as two distinct WCHARs. LanguageCharacterCount() will count it as a single character.

◆ AllocatedChars()

size_t AllocatedChars ( ) const
Remarks
Returns the total number of WCHAR allocated to store the string. Including the NULL character and any unused WCHAR.

◆ isNull()

bool isNull ( ) const
inline
Remarks
Returns TRUE if the string length is 0; otherwise FALSE.
796 { return data()[0]==0; }
const wchar_t * data() const

◆ operator=() [1/4]

WStr& operator= ( const WStr ws)
Remarks
Assignment operator. In release 3.0 and later this operator checks for self-assignment.

◆ operator=() [2/4]

WStr& operator= ( const MaxSDK::Util::MaxString mstr)
Remarks
Assignment operator.

◆ operator=() [3/4]

WStr& operator= ( const wchar_t *  wcstr)
Remarks
Assignment operator.

◆ operator=() [4/4]

WStr& operator= ( const MaxSDK::Util::MaxStringCast< WCHAR > &  mstr)
Remarks
Assignment operator.

◆ operator+()

WStr operator+ ( const WStr ws) const
Remarks
Concatenation operator. Returns a new string that is this string with string ws appended.

◆ operator+=()

WStr& operator+= ( const WStr ws)
Remarks
Concatenation. Returns this string with ws appended.

◆ Append()

WStr& Append ( const WStr ws)
inline
Remarks
Concatenation. Returns this string with ws appended.
815 { return ((*this) += ws); }

◆ append()

WStr& append ( const WStr ws)
inline
Remarks
Concatenation. Returns this string with ws appended.
817 { return ((*this) += ws); }

◆ remove() [1/2]

WStr& remove ( int  pos)
Remarks
Returns this string with N characters removed from pos to the end.
Parameters:
int pos

Specifies the position to begin removing characters.

int N

Specifies the number of characters to remove.

◆ remove() [2/2]

WStr& remove ( int  pos,
int  N 
)

◆ Substr()

WStr Substr ( int  start,
int  nchars 
) const
Remarks
Returns a substring of this string, beginning at position start, of length nchars.

◆ operator[]()

wchar_t operator[] ( int  i) const

Returns the nth character of this string.

Warning: In some environment, this function may return a partial character, especially for Asiatic languages. If you intend to do any advance transformation or interpretation of the returned data, you should consider calling WStr::MultiByteCharacterSubString instead.

Parameters
iIndex of that character.

◆ first()

int first ( wchar_t  c) const
Remarks
Returns the index of the first occurrence of character c in this string. Returns -1 if not found.

◆ last()

int last ( wchar_t  c) const
Remarks
Returns the index of the last occurrence of character c in this string. Returns -1 if not found.

◆ operator==() [1/2]

bool operator== ( const WStr ws) const
Remarks
Equality operator.
Returns
true if the strings are equal; otherwise false.

◆ operator==() [2/2]

bool operator== ( wchar_t  c) const
Remarks
Returns true if this string contain only the character c.

◆ operator!=() [1/2]

bool operator!= ( const WStr ws) const
Remarks
Inequality operator.
Returns
False if the strings are equal; otherwise true.

◆ operator!=() [2/2]

bool operator!= ( wchar_t  c) const
Remarks
Returns true if this string does not contain only the character c.

◆ operator<()

bool operator< ( const WStr ws) const
Remarks
Returns true if this string is less than ws; otherwise false.

◆ operator<=()

bool operator<= ( const WStr ws) const
Remarks
Returns true if this string is less than or equal to ws; otherwise false.

◆ operator>()

bool operator> ( const WStr ws) const
Remarks
Returns true if this string is greater than ws; otherwise false.

◆ operator>=()

bool operator>= ( const WStr ws) const
Remarks
Returns true if this string is greater than or equal to ws; otherwise false.

◆ toUpper()

void toUpper ( )
Remarks
Converts all character of this string to uppercase.

◆ toLower()

void toLower ( )
Remarks
Converts all character of this string to lowercase.

◆ printf()

int printf ( const wchar_t *  format,
  ... 
)

Write a formatted string into this WStr.

Writes the format string, filled in by the optional arguments into this WStr. See the ISO C++ documentation for more information on printf and format strings.

Parameters
formatSpecifies how to format the destination string.
...optional arguments to format into the destination string.
Precondition
format is not null.
There are the correct number of elliptical arguments to fill the format string.
Postcondition
This string is replaced with the formatted string.
Returns
The number of characters written to this string, not including the null terminating character, or a negative value if an error occurs.

◆ printf_l()

int printf_l ( const wchar_t *  format,
const _locale_t  theLocale,
  ... 
)

Write a formatted string into this WStr using specified locale.

Writes the format string, filled in by the optional arguments into this WStr. See the ISO C++ documentation for more information on printf_l and format strings.

Parameters
formatSpecifies how to format the destination string.
theLocaleThe locale to use.
...optional arguments to format into the destination string.
Precondition
format is not null.
There are the correct number of elliptical arguments to fill the format string.
Postcondition
This string is replaced with the formatted string.
Returns
The number of characters written to this string, not including the null terminating character, or a negative value if an error occurs.

◆ vprintf()

int vprintf ( const wchar_t *  format,
va_list  args 
)

Write a formatted string into this WStr.

This method is similar to WStr::printf. Instead of taking a variable list of arguments as parameter, it takes a structure representing a variable list of arguments. This allows WStr objects to be used to build strings based on a format string and a variable number of arguments:

void LogMessage(const wchar_t* format, ...) {
va_list args;
va_start(args, format);
WStr buf;
buf.vprintf(format, args);
va_end(args);
// log the message contained by buf
}
Definition: strclass.h:738
int vprintf(const wchar_t *format, va_list args)
Write a formatted string into this WStr.

◆ vprintf_l()

int vprintf_l ( const wchar_t *  format,
const _locale_t  theLocale,
va_list  args 
)

Write a formatted string into this WStr specified locale.

This method is similar to WStr::printf_l. Instead of taking a variable list of arguments as parameter, it takes a structure representing a variable list of arguments. This allows WStr objects to be used to build strings based on a format string, a locale, and a variable number of arguments:

void LogMessage_l(const wchar_t* format, const _locale_t theLocale, ...) {
va_list args;
va_start(args, format);
WStr buf;
buf.vprintf(format, theLocale, args);
va_end(args);
// log the message contained by buf
}

◆ MultiByteCharacterSubString()

WStr MultiByteCharacterSubString ( int  firstCharacterIndex,
int  numberOfMBCharacters 
) const

◆ ToBSTR()

wchar_t* ToBSTR ( ) const
Remarks
Returns the string in memory allocated by SysAllocString. Caller is responsible for freeing memory using SysFreeString.

◆ FromBSTR()

static WStr FromBSTR ( const wchar_t *  string,
size_t  length = (size_t) -1 
)
static

◆ ToCP()

MaxSDK::Util::MaxStringCastCP ToCP ( UINT  cp,
size_t length = NULL 
) const

◆ FromCP()

static WStr FromCP ( UINT  cp,
const char *  string,
size_t  length = (size_t) -1 
)
static

◆ ToACP()

MaxSDK::Util::MaxStringCast<char> ToACP ( size_t length = NULL) const

◆ FromACP()

static WStr FromACP ( const char *  string,
size_t  length = (size_t) -1 
)
static

◆ ToUTF8()

MaxSDK::Util::MaxStringCastUTF8 ToUTF8 ( size_t length = NULL) const

◆ FromUTF8()

static WStr FromUTF8 ( const char *  string,
size_t  length = (size_t) -1 
)
static

◆ ToOLESTR()

MaxSDK::Util::MaxStringCast<WCHAR> ToOLESTR ( size_t length = NULL) const

◆ FromOLESTR()

static WStr FromOLESTR ( const wchar_t *  string,
size_t  length = (size_t) -1 
)
static

◆ ToUTF16()

MaxSDK::Util::MaxStringCast<WCHAR> ToUTF16 ( size_t length = NULL) const

◆ FromUTF16()

static WStr FromUTF16 ( const wchar_t *  string,
size_t  length = (size_t) -1 
)
static

◆ ToUTF32()

MaxSDK::Util::MaxStringCast<unsigned int> ToUTF32 ( size_t length = NULL) const

◆ FromUTF32()

static WStr FromUTF32 ( const unsigned int string,
size_t  length = (size_t) -1 
)
static

◆ ToMaxString() [1/2]

MaxSDK::Util::MaxString ToMaxString ( ) const

◆ ToMaxString() [2/2]

void ToMaxString ( MaxSDK::Util::MaxString ) const

◆ FromMaxString()

static WStr FromMaxString ( MaxSDK::Util::MaxString string)
inlinestatic
979 { return WStr(string); }

◆ ToCStr()

CStr ToCStr ( ) const

◆ FromCStr()

static WStr FromCStr ( const CStr string)
static

◆ ToWStr()

WStr ToWStr ( ) const
inline
984 { return *this; }

◆ FromWStr()

static WStr FromWStr ( const WStr string)
inlinestatic
985 { return WStr(string); }

◆ ToMCHAR()

const wchar_t* ToMCHAR ( size_t length = NULL) const
inline
988 { return ToUTF16(length); }
MaxSDK::Util::MaxStringCast< WCHAR > ToUTF16(size_t *length=NULL) const
int length() const
Definition: strclass.h:781

◆ FromMCHAR()

static WStr FromMCHAR ( const wchar_t *  string,
size_t  length = (size_t)-1 
)
inlinestatic
989 { return FromUTF16(string, length); }
static WStr FromUTF16(const wchar_t *string, size_t length=(size_t) -1)

◆ ToMSTR()

WStr ToMSTR ( ) const
inline
991 { return *this; }

◆ FromMSTR()

static WStr FromMSTR ( const WStr string)
inlinestatic
992 { return WStr(string); }

◆ EndsWith() [1/2]

bool EndsWith ( const WStr s,
bool  caseSensitive = true 
)

Returns true if the string ends with s; otherwise returns false.

Parameters
sThe string to be searched.
caseSensitiveIf it is true(default), the search is case sensitive; otherwise the search is case insensitive.

◆ EndsWith() [2/2]

bool EndsWith ( wchar_t  c,
bool  caseSensitive = true 
)

Returns true if the string ends with c; otherwise returns false.

This function overloads EndsWith().

Parameters
cThe character to be searched.
caseSensitiveIf it is true(default), the search is case sensitive; otherwise the search is case insensitive.

◆ StartsWith() [1/2]

bool StartsWith ( const WStr s,
bool  caseSensitive = true 
)

Returns true if the string starts with s; otherwise returns false.

Parameters
sThe string to be searched.
caseSensitiveIf it is true(default), the search is case sensitive; otherwise the search is case insensitive.

◆ StartsWith() [2/2]

bool StartsWith ( wchar_t  c,
bool  caseSensitive = true 
)

Returns true if the string starts with c; otherwise returns false.

This function overloads StartsWith().

Parameters
cThe character to be searched.
caseSensitiveIf it is true(default), the search is case sensitive; otherwise the search is case insensitive.

◆ NumberOfLines()

size_t NumberOfLines ( ) const

Returns the number of line feeds inside a string.

◆ Replace()

size_t Replace ( const wchar_t *  pFind,
const wchar_t *  pReplaceBy,
bool  firstOnly = false,
size_t  startPosition = 0 
)

Replaces one substring with another in this string.

Parameters
pFindThe substring to be replaced.
pReplaceByThe string the substring is to be replaced with.
firstOnlyIf true, only first occurrence of 'from' is replaced, otherwise all occurrences are replaced
startPositionThe character position to start searching from
Returns
Returns the number of replacements made.