Formatting data

VB.NET expressions allow a wide range of formatting, using the String.Format method. This is a very powerful method that allows you to format text, numbers, dates and times.
The method looks like this:
String.Format( FormatString, Value, Value... )
The format string contains plain text and parameter references. For example:
{ String.Format("{0} is {1}", "variaDoc", "cool") }
will result in:
variaDoc is cool
Go to inline format specifiers for a list of possible format strings.

Parameter references

The parameter references {0} and {1} are replaced by the values of their respective parameters. There can be any number of parameters. The parameters are numbered left to right starting at 0.

Overriding regional settings

Up to this point we’ve seen formatting based on the regional settings of the computer that is running variaDoc. You can however override this and force formatting to use different settings.
Overriding can be done on project level or per expression as demonstrates below.
{ String.Format( New Globalization.CultureInfo("de-DE"), "Der Preis ist : {0:C}", 1428.79) }
This will format the currency using the German regional settings ( de-DE ). Consequently, the currency symbol is Euro and the number is formatted a bit differently:
Der Preis ist : 1.428,79 1