RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
AnsiStringT::cat_sprintf Method

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

Pascal
function cat_sprintf(const format: char*; : ...): AnsiStringT&; cdecl;
C++
__cdecl AnsiStringT& cat_sprintf(const char* format, ...);

Use cat_System::AnsiStringT::cat_sprintf to append to the value of the System::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 System::AnsiStringT with the value

Dear Mr. Smith,

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

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!