From RAD Studio API Documentation
Jump to: navigation, search


AnsiStringT& __cdecl cat_sprintf(const char* format, ...) {


Type Visibility Source Unit Parent
function public dstring.h System AnsiStringT


Appends the result of a given format string and its arguments to the end of the AnsiStringT.

Use cat_cat_sprintf to append to the value of the AnsiStringT, 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:

AnsiString Salutation = "Mr."
AnsiString s = "";
s.cat_sprintf("Dear %s ", Salutation);
s.cat_sprintf("%s,", "Smith");

results in an AnsiStringT with the value

Dear Mr. Smith,

This method returns a reference to the AnsiStringT (*this) with the resulting value.

See Also