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"

Padding Strings

Select Case Variable & Microsoft.VisualBasic.Space(20 - Variable.Length) 
   Case "-----------20 chars-------"
   Case "MyVariable---------------"
End Select

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