Ltrim Function in VB.NET

How to use Ltrim Function in VB.NET?

Explanation

LTrim Function

Ltrim Function in Visual Basic.net 2008 retruns a copy of a string without leading spaces.
Syntax:

Function LTrim(ByVal Str As String) As String

In the above syntax the Str is the string from which the leading spaces are removed.
Example:

Module Module1
Sub Main()
Console.WriteLine("String after removing
leading spaces is::" & LTrim("
3Spaces"))
Console.ReadLine()
End Sub
End Module
Result:

String after removing leading spaces is::3Spaces

In the above example, three leading spaces from the string '3Spaces' are removed using the LTrim function.

Visual Basic Tutorial


Ask Questions

Ask Question