Strings.Space(Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一個由指定空格數組成的字串。
public:
static System::String ^ Space(int Number);
public static string Space(int Number);
static member Space : int -> string
Public Function Space (Number As Integer) As String
參數
- Number
- Int32
必須的。
Integer 表達式。 你想要的字串空格數。
傳回
一個由指定空格數組成的字串。
例外狀況
Number
< 0。
範例
此範例使用函 Space 式回傳由指定空格數組成的字串。
Dim testString As String
' Returns a string with 10 spaces.
testString = Space(10)
' Inserts 10 spaces between two strings.
testString = "Hello" & Space(10) & "World"
備註
此 Space 函式對於格式化輸出及清除固定長度字串中的資料非常有用。