this-> Format

(Caronte Pcode version 2.0)

Format -- Output a formatted string

Description

string this-> Format ( string format , mixed ... );

% - a literal percent character. No argument is required.
c - the argument is treated as an integer, and presented as the character with that ASCII value.
d - the argument is treated as an integer, and presented as a (signed) decimal number.
u - the argument is treated as an integer, and presented as an unsigned decimal number.
f - the argument is treated as a float, and presented as a floating-point number (locale aware).
s - the argument is treated as and presented as a string.
x - the argument is treated as an integer and presented as a hexadecimal number (with lowercase letters).
X - the argument is treated as an integer and presented as a hexadecimal number (with uppercase letters).

Example Argument swapping

Source:

CS_ANTISPAM_SCRIPT this = new CS_ANTISPAM_SCRIPT($_this);
string formated = "";
string location = "alto a destra";
int num = 1;

formated = this->Format("Dov'è la %d scimmina in %s",num, location);

this->Print(formated);


Out:

Dov'è la 1 scimmina in alto a destra