Left Function in VB.NET

What is the use of Left() string function in VB.NET?


Left Function

Left Function in Visual Basic.net 2008 returns the specifed number of characters from the left of a string.

Function Left(ByVal str As String,
ByVal Length As Integer) As String

In the above syntax the number of character specified in the Length is returned from the left of the String.

Module Module1
Sub Main()
Dim Str As String = "RETURN for LEFT Function"
Console.WriteLine("String returned is::" & Left(Str, 6))
End Sub
End Module

String returned is:: RETURN

In the above example, 6 characters from the left most part of the string is returned.

Visual Basic Tutorial

Ask Questions

Ask Question