Example. This program declares and assigns into a character array. Next, we invoke the String constructor, and pass the identifier of the character array reference in the argument slot.
Result The String constructor returns a new string. We assign a reference variable to it.
Detail The character array was assembled into a complete string, which can be used throughout your program.
' Create a Char array using assignment syntax.
Dim arr(8) As Char
arr(0) = "T"
arr(1) = "h"
arr(2) = "a"
arr(3) = "n"
arr(4) = "k"
arr(5) = " "
arr(6) = "y"
arr(7) = "o"
arr(8) = "u"' Create a String from the Char array.
Dim value As String = New String(arr)
Console.WriteLine(value = "Thank you")
In my experience, this approach to String construction is often the fastest. Another efficient way is to use a lookup table and avoid creating a new String in the first place.