- 04 May 2024
- 1 Minute to read
- DarkLight
String
- Updated on 04 May 2024
- 1 Minute to read
- DarkLight
General
The string data type contains data in textual format and can hold a number of unicode characters. A detailed explanation of the string data type can be found in the String Data-Type article of the Visual Basic .NET language documentation.
Constants
Constant string values have to be enclosed in double-quotes; the following expression returns the string Hello World:
"Hello World"
Operators
The string data type supports the following operators:
& (Concatenation)
You can concatenate two strings by using the & operator. The following example combines two string constants:
"Hello " & "World"
The following expression returns the constant string Today is: concatenated with the current Date-Time formatted to a string with a Format String of dd.MM.yyyy (e.g. Today is: 31.12.2021) using the Format function:
"Today is: " & Format(DateTime.Today, "dd.MM.yyyy")