Strings.LSet(String, Int32) Metoda

Definice

Vrátí řetězec zarovnaný doleva obsahující zadaný řetězec upravený na zadanou délku.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

Parametry

Source
String

Povinná hodnota.Required. String vyjádření.String expression. Název řetězcové proměnné.Name of string variable.

Length
Int32

Povinná hodnota.Required. Integer vyjádření.Integer expression. Délka vráceného řetězceLength of returned string.

Návraty

String

Řetězec zarovnaný doleva obsahující zadaný řetězec upravený na zadanou délku.A left-aligned string containing the specified string adjusted to the specified length.

Příklady

Tento příklad ukazuje použití LSet funkce.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)

Poznámky

Pokud je zadaný řetězec delší než zadaná délka, vrácený řetězec se zkrátí na zadanou délku.If the specified string is longer than the specified length, the returned string is shortened to the specified length. Pokud je zadaný řetězec kratší než zadaná délka, přidají se mezery na pravý konec vráceného řetězce, aby se vytvořila příslušná délka.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.

Platí pro

Viz také