System.UnicodeString.cat_sprintf
C++
UnicodeString& __cdecl cat_sprintf(const wchar_t* format, ...); // Returns *this
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | ustring.h | System | UnicodeString |
Description
Appends result of given format string and its arguments to end of UnicodeString.
Use cat_sprintf to append to the value of the UnicodeString object, given a standard C++ format specifier. Pass the values to any arguments in the format specifier as additional parameters following the format parameter.
For example, the following code:
UnicodeString Salutation = "Mr." UnicodeString s = ""; s.cat_sprintf("Dear %s ", Salutation); s.cat_sprintf("%s,", "Smith");
results in an UnicodeString object with the value
Dear Mr. Smith,
This method returns a reference to the UnicodeString object (*this) with the resulting value.
Warning: The value returned by UnicodeString.c_str() under OS X and iOS is char16_t* while the cat_sprintf function expects wchar_t*.