Append to string |
![]() |
|
|
|
|
|
This method will append a specified number of characters (howmany) to the end of the string object current value.
If the value for howmany is not specified (i.e. the default of -1 is used), or the value for howmany is greater than the length of s, the entire string at s will be appended.
|
|
|
|
|
These two methods (and the two operator overloads, which have the exact same function) will append the string s at the end of the string object current value.
Platforms that support Unicode with accept both ANSI and Unicode strings to be catenated, regardless of the mode in which Str Library is compiled. When conversion needs to occur, however, performance will suffer somewhat.
For convenience, the AppendString methods return a self reference to the called object.
Example:
Str s (_T("X "));
s += "Y "; // Uses the LPCSTR overload
s += Str(_T("Z ")); // Uses the const Str& overload
s.AppendString (_T("123"));
ASSERT (s == _T("X Y Z 123"));
|
|
|
|
|
This form of AppendString, and its equivalent += operator, will append the passed string at the end of the current object value. See AppendString (C-style) above for example.
For convenience, AppendString returns a self reference to the called object (not to the passed source string!)
See also: Adding to Strings, Append other items to string