Append other items to string

Web Site  Methods

 
Str::AppendChar
Equivalent to: Str::operator += (STRCHAR)
 
Str& AppendChar (STRCHAR ch)
void operator += (STRCHAR ch)

AppendChar, and its equivalent operator += overload, will append a single character to the end of the string's current value. The character passed cannot be null.

For convenience, the method returns a self reference to the called object.

 

 
Str::AppendInt
 
Str& AppendInt (int val)

AppendInt will append the decimal representation of the passed integer value to the end of the string.  If the value is negative, a - sign is added before the digits.

For convenience, the method returns a self reference to the called object.

 

 
Str::AppendDouble
 
Str& AppendDouble (double val, UINT after_dot)

AppendDouble will append the decimal representation of the passed double value to the end of the string.  Exponent notation will not be used unless necessary. Negative values will have a - sign added before the digits.

To control the formatting more precisely that AppendInt / AppendDouble / AppendFloat allow, use Format or AppendFormat.

For convenience, the method returns a self reference to the called object.

 

 
Str::AppendFloat
 
Str& AppendFloat (float val, UINT after_dot)

AddFloat will append the decimal representation of the passed single-precision value to the end of the string.  Exponent notation will not be used unless necessary. Negative values will have a - sign added before the digits.

For convenience, the method returns a self reference to the called object.

 

See also: Adding to Strings, Formatting (sprintf-style)