GetChar Function in VB.NET

How to use GetChar Function?


GetChar Function

GetChar Function in Visual 2008 is used to return the character of the string from the specified index.

Function GetChar(ByVal str As String,
ByVal Index As Integer) As Char

In the above syntax String specifies the string from which the character with the Index value is returned.

Module Module1
Sub Main()
Dim Str As String
Str = "Hscripts Welcomes You"
Console.WriteLine("Character at the index value
4 is::" & GetChar(Str, 4))
End Sub
End Module

Character at the index value 4 is:: r

In the above GetChar Function example, the character 'r' is at the index 4 of the given string.

Visual Basic Tutorial

Ask Questions

Ask Question