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

定義

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

public:
 static System::String ^ LSet(System::String ^ Source, int Length);
public static string LSet(string? Source, int Length);
public static string LSet(string Source, int Length);
static member LSet : string * int -> string
Public Function LSet (Source As String, Length As Integer) As String

パラメーター

Source
String

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

Length
Int32

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

返品

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

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

Dim testString As String = "Left"
Dim lString As String
' Returns "Left      "
lString = LSet(testString, 10)
' Returns "Le"
lString = LSet(testString, 2)
' Returns "Left"
lString = LSet(testString, 4)

注釈

指定した文字列が指定した長さより長い場合、返される文字列は指定した長さに短縮されます。 指定した文字列が指定した長さよりも短い場合は、返された文字列の右端にスペースが追加され、適切な長さが生成されます。

適用対象

こちらもご覧ください