Strings.StrDup Metoda

Definice

Vrátí řetězec nebo objekt skládající se ze zadaného znaku, který se opakuje po zadaném počtu opakování.Returns a string or object consisting of the specified character repeated the specified number of times.

Přetížení

StrDup(Int32, Char)

Vrátí řetězec nebo objekt skládající se ze zadaného znaku, který se opakuje po zadaném počtu opakování.Returns a string or object consisting of the specified character repeated the specified number of times.

StrDup(Int32, Object)

Vrátí řetězec nebo objekt skládající se ze zadaného znaku, který se opakuje po zadaném počtu opakování.Returns a string or object consisting of the specified character repeated the specified number of times.

StrDup(Int32, String)

Vrátí řetězec nebo objekt skládající se ze zadaného znaku, který se opakuje po zadaném počtu opakování.Returns a string or object consisting of the specified character repeated the specified number of times.

StrDup(Int32, Char)

Vrátí řetězec nebo objekt skládající se ze zadaného znaku, který se opakuje po zadaném počtu opakování.Returns a string or object consisting of the specified character repeated the specified number of times.

public:
 static System::String ^ StrDup(int Number, char Character);
public static string StrDup (int Number, char Character);
static member StrDup : int * char -> string
Public Function StrDup (Number As Integer, Character As Char) As String

Parametry

Number
Int32

Povinná hodnota.Required. Integer vyjádření.Integer expression. Délka řetězce, který má být vrácen.The length to the string to be returned.

Character
Char

Povinná hodnota.Required. Libovolný platný Char String výraz, nebo Object .Any valid Char, String, or Object expression. Bude použit pouze první znak výrazu.Only the first character of the expression will be used. Je-li znak typu Object , musí obsahovat buď hodnotu, Char nebo String .If Character is of type Object, it must contain either a Char or a String value.

Návraty

String

Řetězec nebo objekt skládající se ze zadaného znaku, který se opakuje po zadaném počtu opakování.A string or object consisting of the specified character repeated the specified number of times.

Výjimky

Number je menší než 0 nebo Character typ není platný.Number is less than 0 or Character type is not valid.

Character je Nothing.Character is Nothing.

Příklady

Tento příklad používá StrDup funkci k vrácení řetězce duplicitních znaků.This example uses the StrDup function to return a string of duplicated characters.

Dim aString As String = "Wow! What a string!"
Dim aObject As New Object
Dim testString As String
aObject = "This is a String contained within an Object"
' Returns "PPPPP"
testString = StrDup(5, "P")
' Returns "WWWWWWWWWW"
testString = StrDup(10, aString)
' Returns "TTTTTT"
testString = CStr(StrDup(6, aObject))

Poznámky

Tato funkce vrátí String tvořené opakované znaky.This function returns a String made up of repeated characters. Znak, který tvoří řetězec, je prvním znakem v Character argumentu a je tento počet duplicitních Number .The character that makes up the string is the first character in the Character argument, and it is duplicated Number number of times.

Viz také

Platí pro

StrDup(Int32, Object)

Vrátí řetězec nebo objekt skládající se ze zadaného znaku, který se opakuje po zadaném počtu opakování.Returns a string or object consisting of the specified character repeated the specified number of times.

public:
 static System::Object ^ StrDup(int Number, System::Object ^ Character);
public static object StrDup (int Number, object Character);
static member StrDup : int * obj -> obj
Public Function StrDup (Number As Integer, Character As Object) As Object

Parametry

Number
Int32

Povinná hodnota.Required. Integer vyjádření.Integer expression. Délka řetězce, který má být vrácen.The length to the string to be returned.

Character
Object

Povinná hodnota.Required. Libovolný platný Char String výraz, nebo Object .Any valid Char, String, or Object expression. Bude použit pouze první znak výrazu.Only the first character of the expression will be used. Je-li znak typu Object , musí obsahovat buď hodnotu, Char nebo String .If Character is of type Object, it must contain either a Char or a String value.

Návraty

Object

Řetězec nebo objekt skládající se ze zadaného znaku, který se opakuje po zadaném počtu opakování.A string or object consisting of the specified character repeated the specified number of times.

Výjimky

Number je menší než 0 nebo Character typ není platný.Number is less than 0 or Character type is not valid.

Character je Nothing.Character is Nothing.

Příklady

Tento příklad používá StrDup funkci k vrácení řetězce duplicitních znaků.This example uses the StrDup function to return a string of duplicated characters.

Dim aString As String = "Wow! What a string!"
Dim aObject As New Object
Dim testString As String
aObject = "This is a String contained within an Object"
' Returns "PPPPP"
testString = StrDup(5, "P")
' Returns "WWWWWWWWWW"
testString = StrDup(10, aString)
' Returns "TTTTTT"
testString = CStr(StrDup(6, aObject))

Poznámky

Tato funkce vrátí String tvořené opakované znaky.This function returns a String made up of repeated characters. Znak, který tvoří řetězec, je prvním znakem v Character argumentu a je tento počet duplicitních Number .The character that makes up the string is the first character in the Character argument, and it is duplicated Number number of times.

Viz také

Platí pro

StrDup(Int32, String)

Vrátí řetězec nebo objekt skládající se ze zadaného znaku, který se opakuje po zadaném počtu opakování.Returns a string or object consisting of the specified character repeated the specified number of times.

public:
 static System::String ^ StrDup(int Number, System::String ^ Character);
public static string StrDup (int Number, string Character);
static member StrDup : int * string -> string
Public Function StrDup (Number As Integer, Character As String) As String

Parametry

Number
Int32

Povinná hodnota.Required. Integer vyjádření.Integer expression. Délka řetězce, který má být vrácen.The length to the string to be returned.

Character
String

Povinná hodnota.Required. Libovolný platný Char String výraz, nebo Object .Any valid Char, String, or Object expression. Bude použit pouze první znak výrazu.Only the first character of the expression will be used. Je-li znak typu Object , musí obsahovat buď hodnotu, Char nebo String .If Character is of type Object, it must contain either a Char or a String value.

Návraty

String

Řetězec nebo objekt skládající se ze zadaného znaku, který se opakuje po zadaném počtu opakování.A string or object consisting of the specified character repeated the specified number of times.

Výjimky

Number je menší než 0 nebo Character typ není platný.Number is less than 0 or Character type is not valid.

Character je Nothing.Character is Nothing.

Příklady

Tento příklad používá StrDup funkci k vrácení řetězce duplicitních znaků.This example uses the StrDup function to return a string of duplicated characters.

Dim aString As String = "Wow! What a string!"
Dim aObject As New Object
Dim testString As String
aObject = "This is a String contained within an Object"
' Returns "PPPPP"
testString = StrDup(5, "P")
' Returns "WWWWWWWWWW"
testString = StrDup(10, aString)
' Returns "TTTTTT"
testString = CStr(StrDup(6, aObject))

Poznámky

Tato funkce vrátí String tvořené opakované znaky.This function returns a String made up of repeated characters. Znak, který tvoří řetězec, je prvním znakem v Character argumentu a je tento počet duplicitních Number .The character that makes up the string is the first character in the Character argument, and it is duplicated Number number of times.

Viz také

Platí pro