Strings.LSet(String, Int32) Método
Definición
Devuelve una cadena alineada a la izquierda que contiene la cadena especificada ajustada a la longitud indicada.Returns a left-aligned string containing the specified string adjusted to the specified length.
public:
static System::String ^ LSet(System::String ^ Source, int Length);
public static string LSet (string? Source, int Length);
public static string LSet (string Source, int Length);
static member LSet : string * int -> string
Public Function LSet (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
Cadena alineada a la izquierda que contiene la cadena especificada ajustada a la longitud indicada.A left-aligned string containing the specified string adjusted to the specified length.
Ejemplos
En este ejemplo se muestra el uso de la LSet función.This example demonstrates the use of the LSet function.
Dim testString As String = "Left"
Dim lString As String
' Returns "Left "
lString = LSet(testString, 10)
' Returns "Le"
lString = LSet(testString, 2)
' Returns "Left"
lString = LSet(testString, 4)
Comentarios
Si la cadena especificada es mayor que la longitud especificada, la cadena devuelta se acorta a la longitud especificada.If the specified string is longer than the specified length, the returned string is shortened to the specified length. Si la cadena especificada es más corta que la longitud especificada, se agregan espacios al extremo derecho de la cadena devuelta para generar la longitud adecuada.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.