Insert in string

Web Site  Methods

 
Str::Insert
 
Str& Insert (const STRCHAR* s, CPOS startat, CPOS howmany = (CPOS) -1)

This method will insert the first howmany characters from s (or the entire s, if howmany is left at its default value or is bigger than the length of s) into the string object. The insertion will begin at the 0-based position startat.

If the startat parameter is beyond the end of the string object current value, an exception (program error) will be thrown.

For convenience, returns a reference to self.

 

 
Str::InsertAtLeft
 
Str& InsertAtLeft (const STRCHAR* s, CPOS howmany = (CPOS) -1)

Inserts characters from s at the beginning of the string object.  Equivalent to invoking Insert (s, 0, howmany).

For convenience, returns a reference to self.

 

See also: Adding to Strings