Strings.RSet(String, Int32) Metoda

Definice

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

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ý vpravo obsahující zadaný řetězec upravený na zadanou délku.A right-aligned string containing the specified string adjusted to the specified length.

Příklady

Tento příklad ukazuje použití RSet funkce.This example demonstrates the use of the RSet function.

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

Poznámky

Pokud Source je delší než Length , RSet umístí pouze znaky zcela vlevo, až do délky Source , ve vráceném řetězci.If Source is longer than Length, RSet places only the leftmost characters, up to the length of Source, in the returned string. Pokud je zadaný řetězec kratší než zadaná délka, přidají se mezery na levý konec ř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 left end of the string to produce the appropriate length. Pokud je zadaný řetězec delší než zadaná délka, je zkrácen na zadanou délku.If the specified string is longer than the specified length, it is shortened to the specified length.

Platí pro

Viz také