Strings.RSet(String, Int32) メソッド

定義

指定した長さに調整された、指定した文字列を含む右揃えの文字列を返します。

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

パラメーター

Source
String

必須。 String 式。 文字列変数の名前。

Length
Int32

必須。 Integer 式。 返される文字列の長さ。

返品

指定した長さに調整された、指定した文字列を含む右揃えの文字列。

この例では、 RSet 関数の使用方法を示します。

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

注釈

SourceLengthより長い場合、RSetは、返された文字列の左端の文字 (Sourceの長さまで) のみを配置します。 指定した文字列が指定した長さよりも短い場合は、文字列の左端にスペースが追加され、適切な長さが生成されます。 指定した文字列が指定した長さより長い場合は、指定した長さに短縮されます。

適用対象

こちらもご覧ください