Strings.Space(Int32) Metoda

Definice

Vrátí řetězec sestávající z určeného počtu mezer.Returns a string consisting of the specified number of spaces.

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

Parametry

Number
Int32

Povinná hodnota.Required. Integer vyjádření.Integer expression. Počet mezer, které mají být v řetězci.The number of spaces you want in the string.

Návraty

String

Řetězec sestávající z určeného počtu mezer.A string consisting of the specified number of spaces.

Výjimky

Number<0.Number < 0.

Příklady

Tento příklad používá Space funkci k vrácení řetězce, který se skládá z určeného počtu mezer.This example uses the Space function to return a string consisting of a specified number of spaces.

Dim testString As String
' Returns a string with 10 spaces.
testString = Space(10)
' Inserts 10 spaces between two strings.
testString = "Hello" & Space(10) & "World"

Poznámky

SpaceFunkce je užitečná pro formátování výstupu a mazání dat v řetězcích s pevnou délkou.The Space function is useful for formatting output and clearing data in fixed-length strings.

Platí pro

Viz také