Strings.RSet(String, Int32) 方法

定義

回傳一個右對齊的字串,包含調整至指定長度的指定字串。

public:
 static System::String ^ RSet(System::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

參數

Source
String

必須的。 String 表達式。 字串變數名稱。

Length
Int32

必須的。 Integer 表達式。 回送弦的長度。

傳回

一個右對齊的字串,包含指定字串並調整至指定長度。

範例

此範例展示了該函數的 RSet 使用。

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

備註

Source 長於 LengthRSet 則僅將最左邊的字元(長度不超過 Source)放入返回字串。 若指定字串長度短於指定長度,則會在字串左端加上空格以產生適當的長度。 若指定的弦長超過指定長度,則縮短為指定長度。

適用於

另請參閱