C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Note: You can see that the character array contains the same five characters as the original string.
For Each, ForVB.NET program that uses ToCharArray function
Module Module1
Sub Main()
' String input value.
Dim value As String = "Perls"
' Call ToCharArray function.
Dim array() As Char = value.ToCharArray
' Loop over Char array.
For Each element As Char In array
Console.WriteLine(element)
Next
End Sub
End Module
Output
P
e
r
l
s
Note: You can change the individual characters in a Char array without copying the entire set of characters again.
Char Array