Export (0) Print
Expand All

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      "
LString = LSet(myString, 2)    ' Returns "Le"
LString = LSet(myString, 4)    ' Returns "Left"

Requirements

Namespace: Microsoft.VisualBasic

Module: Strings

Assembly: Microsoft Visual Basic .NET Runtime (in Microsoft.VisualBasic.dll)

See Also

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

Show:
© 2014 Microsoft