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 函数可用于格式化固定长度字符串中的输出和清除数据。