Strings.RSet(String, Int32) Yöntem
Tanım
Belirtilen uzunluğa ayarlanmış belirtilen dizeyi içeren sağa hizalanmış bir dize döndürür.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
Parametreler
- Source
- String
Gereklidir.Required. String ifadesini.String expression. Dize değişkeninin adı.Name of string variable.
- Length
- Int32
Gereklidir.Required. Integer ifadesini.Integer expression. Döndürülen dize uzunluğu.Length of returned string.
Döndürülenler
Belirtilen uzunluğa ayarlanmış belirtilen dizeyi içeren sağa hizalanmış bir dize.A right-aligned string containing the specified string adjusted to the specified length.
Örnekler
Bu örnek, işlevinin kullanımını gösterir RSet .This example demonstrates the use of the RSet function.
Dim testString As String = "Right"
' Returns " Right"
Dim rString As String = RSet(testString, 11)
Açıklamalar
, ' Source Den büyükse Length , RSet döndürülen dizedeki yalnızca en soldaki karakterleri uzunluğuna kadar koyar Source .If Source is longer than Length, RSet places only the leftmost characters, up to the length of Source, in the returned string. Belirtilen dize belirtilen uzunluktan kısaysa, uygun uzunluğu oluşturmak için dizenin sol sonuna boşluklar eklenir.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. Belirtilen dize belirtilen uzunluktan uzunsa, belirtilen uzunluğa kısaltıldı.If the specified string is longer than the specified length, it is shortened to the specified length.