What Is {0} in Visual Basic?
- String functions such as .Write() or .String.Format() use curly braces to indicate the array index value to be passed into the function. To output the first item in the array, myListOfItems, you could use the code, "MyString.Write("The first item is {0}.", myListOfItems)".
- An alternate use of curly braces in Visual Basic comes in initializing arrays when they're created. For instance, a programmer might code "Dim intNewArray() as Integer = {0}", putting zero in the first element of the array "intNewArray".
- An unconventional use of "{0}" utilizes the fact that the Visual Basic compiler considers 0 to be false. That means that a block of code could use "{0}" as a placeholder to do nothing.
Specifying Parameters
Initializing Arrays
Zero as False
Source...