Strings.RSet(String, Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一個右對齊的字串,包含調整至指定長度的指定字串。
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 長於 Length, RSet 則僅將最左邊的字元(長度不超過 Source)放入返回字串。 若指定字串長度短於指定長度,則會在字串左端加上空格以產生適當的長度。 若指定的弦長超過指定長度,則縮短為指定長度。