How to: Create a String from An Array of Char Values (Visual Basic)
This example creates the string "abcd" from individual characters.
Example
Private Sub MakeStringFromCharacters()
Dim characters() As Char = {"a"c, "b"c, "c"c, "d"c}
Dim alphabet As New String(characters)
End Sub
Compile the code
This method has no special requirements.
The syntax "a"c
, where a single c
follows a single character in quotation marks, is used to create a character literal.
Robust Programming
Null characters (equivalent to Chr(0)
) in the string lead to unexpected results when using the string. The null character will be included with the string, but characters following the null character will not be displayed in some situations.
See also
Sodelujte z nami v storitvi GitHub
Vir za to vsebino najdete v storitvi GitHub, kjer lahko tudi ustvarite in pregledate težave in zahtevke za uveljavitev sprememb. Če želite več informacij, glejte naš vodnik za sodelavce.
Povratne informacije
https://aka.ms/ContentUserFeedback.
Kmalu na voljo: V letu 2024 bomo ukinili storitev Težave v storitvi GitHub kot mehanizem za povratne informacije za vsebino in jo zamenjali z novim sistemom za povratne informacije. Za več informacij si oglejte:Pošlji in prikaži povratne informacije za