Strings.RSet(String, Int32) Método

Definición

Devuelve una cadena alineada a la derecha que contiene la cadena especificada y con la longitud especificada.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

Parámetros

Source
String

Obligatorio.Required. Expresión String.String expression. Nombre de variable de cadena.Name of string variable.

Length
Int32

Obligatorio.Required. Expresión Integer.Integer expression. Longitud de la cadena devuelta.Length of returned string.

Devoluciones

String

Cadena alineada a la derecha que contiene la cadena especificada y con la longitud especificada.A right-aligned string containing the specified string adjusted to the specified length.

Ejemplos

En este ejemplo se muestra el uso de la RSet función.This example demonstrates the use of the RSet function.

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

Comentarios

Si Source es mayor que Length , RSet coloca solo los caracteres situados más a la izquierda, hasta la longitud de Source , en la cadena devuelta.If Source is longer than Length, RSet places only the leftmost characters, up to the length of Source, in the returned string. Si la cadena especificada es más corta que la longitud especificada, se agregan espacios en el extremo izquierdo de la cadena para generar la longitud adecuada.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. Si la cadena especificada es mayor que la longitud especificada, se acorta a la longitud especificada.If the specified string is longer than the specified length, it is shortened to the specified length.

Se aplica a

Consulte también