RSet Function
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

RSet Function

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

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


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


If Source is longer than Length, RSet places only the leftmost characters, up to the length of Source, in the returned string. If the specified string is shorter than the specified length, spaces are added to the left end of the string to produce the appropriate length. If the specified string is longer than the specified length, it is shortened to the specified length.


This example demonstrates the use of the RSet function.

Dim myString As String = "Right"
Dim rString As String
rString = RSet(myString, 11)   ' Returns "      Right"


Namespace: Microsoft.VisualBasic

Module: Strings

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

See Also

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

© 2015 Microsoft