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
式適用於格式化輸出和清除固定長度字串中的資料。
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應