Edit

Share via


Strings.RSet(String, Int32) Method

Definition

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

public:
 static System::String ^ RSet(System::String ^ Source, int Length);
public static string RSet (string? Source, int Length);
public static string RSet (string Source, int Length);
static member RSet : string * int -> string
Public Function RSet (Source As String, Length As Integer) As String

Parameters

Source
String

Required. String expression. Name of string variable.

Length
Int32

Required. Integer expression. Length of returned string.

Returns

A right-aligned string containing the specified string adjusted to the specified length.

Examples

This example demonstrates the use of the RSet function.

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

Remarks

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.

Applies to

See also