Also called Composite Formatting
The Format method of the String class allows you to format a string and include one or more numeric or datetime values in it.
A strings can contain placeholders for arguments, the format {N} where N is an index that starts at 0.

string sResult; 
string sVariableName;
sVariableName = "Russell"
sResult = System.String.Format("The value of variable {0} is {1}", "sVariableName", sVariableName)
sResult = "The value of variable sVariableName is Russell"

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext