Visual Basic Language Reference  

LSet Function

Returns a left-aligned string containing the specified string adjusted to the specified length.

Public Shared Function LSet( _
   ByVal Source As String, _
   ByVal Length As Integer _
) As String

Parameters

Source
Required. String expression. Name of string variable.
Length
Required. Integer expression. Length of returned string.

Remarks

If the specified string is longer than the specified length, the returned string is shortened to the specified length. If the specified string is shorter than the specified length, spaces are added to the right end of the returned string to produce the appropriate length.

Example

This example demonstrates the use of the LSet function.

Dim myString As String = "Left"
Dim lString As String
LString = LSet(myString, 10)   ' Returns "Left      "

See Also

Data Type Summary | RSet Function | Efficient Use of Data Types