RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
AnsiString::cat_sprintf Method

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

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

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

Dear Mr. Smith,

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

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!