C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
VB.NET program that uses LTrim function
Module Module1
Sub Main()
Dim value1 As String = " The Dev Codes"
Dim value2 As String = LTrim(value1)
Console.WriteLine("[{0}]", value2)
End Sub
End Module
Output
[The Dev Codes]
But: It would be more efficient to simply call TrimStart yourself. This is possible without too much trouble.
IL Disassembler TutorialTrimEnd, TrimStartOutput: We can see that there are no trailing spaces remaining on the right side of the string value.
Note: The original String literal is unchanged, but changes are made to another copy which is displayed.
VB.NET program that calls RTrim
Module Module1
Sub Main()
Dim value1 As String = "The Dev Codes "
Dim value2 As String = RTrim(value1)
Console.WriteLine("[{0}]", value2)
End Sub
End Module
Output
[The Dev Codes]