Mega Code Archive

 
Categories / VB.Net Tutorial / Data Type
 

Copy characters from string1 into character Array

Module Tester    Sub Main()       Dim string1 As String       Dim characterArray As Char()       Dim i As Integer       Dim quotes As Char = ChrW(34)       string1 = "hello there"       characterArray = New Char(5) {}       string1.CopyTo(0, characterArray, 0, 5)       For i = 0 To characterArray.GetUpperBound(0)          Console.WriteLine(characterArray(i))       Next    End Sub ' Main End Module h e l o