Strings.StrDup Yöntem
Tanım
Belirtilen karakterin belirtilen sayıda yinelenmesinden oluşan bir dize veya nesne döndürür.Returns a string or object consisting of the specified character repeated the specified number of times.
Aşırı Yüklemeler
| StrDup(Int32, Char) |
Belirtilen karakterin belirtilen sayıda yinelenmesinden oluşan bir dize veya nesne döndürür.Returns a string or object consisting of the specified character repeated the specified number of times. |
| StrDup(Int32, Object) |
Belirtilen karakterin belirtilen sayıda yinelenmesinden oluşan bir dize veya nesne döndürür.Returns a string or object consisting of the specified character repeated the specified number of times. |
| StrDup(Int32, String) |
Belirtilen karakterin belirtilen sayıda yinelenmesinden oluşan bir dize veya nesne döndürür.Returns a string or object consisting of the specified character repeated the specified number of times. |
StrDup(Int32, Char)
Belirtilen karakterin belirtilen sayıda yinelenmesinden oluşan bir dize veya nesne döndürür.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
Parametreler
- Number
- Int32
Gereklidir.Required. Integer ifadesini.Integer expression. Döndürülecek dizenin uzunluğu.The length to the string to be returned.
- Character
- Char
Gereklidir.Required. Herhangi bir geçerli Char , String veya Object ifadesi.Any valid Char, String, or Object expression. İfadenin yalnızca ilk karakteri kullanılacaktır.Only the first character of the expression will be used. Karakter türü ise, ya Object da Char bir String değer içermelidir.If Character is of type Object, it must contain either a Char or a String value.
Döndürülenler
Belirtilen karakterden oluşan bir dize veya nesne, belirtilen sayıda tekrarlanıyor.A string or object consisting of the specified character repeated the specified number of times.
Özel durumlar
Number 0 ' dan küçük veya Character tür geçerli değil.Number is less than 0 or Character type is not valid.
Character, Nothing değeridir.Character is Nothing.
Örnekler
Bu örnek, StrDup yinelenen karakterlerin bir dizesini döndürmek için işlevini kullanır.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))
Açıklamalar
Bu işlev, yinelenen karakterlerden oluşan bir sonuç döndürür String .This function returns a String made up of repeated characters. Dizeyi oluşturan karakter, Character bağımsız değişkenin ilk karakteridir ve yinelenen sayı olarak yinelenir Number .The character that makes up the string is the first character in the Character argument, and it is duplicated Number number of times.
Ayrıca bkz.
Şunlara uygulanır
StrDup(Int32, Object)
Belirtilen karakterin belirtilen sayıda yinelenmesinden oluşan bir dize veya nesne döndürür.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
Parametreler
- Number
- Int32
Gereklidir.Required. Integer ifadesini.Integer expression. Döndürülecek dizenin uzunluğu.The length to the string to be returned.
- Character
- Object
Gereklidir.Required. Herhangi bir geçerli Char , String veya Object ifadesi.Any valid Char, String, or Object expression. İfadenin yalnızca ilk karakteri kullanılacaktır.Only the first character of the expression will be used. Karakter türü ise, ya Object da Char bir String değer içermelidir.If Character is of type Object, it must contain either a Char or a String value.
Döndürülenler
Belirtilen karakterden oluşan bir dize veya nesne, belirtilen sayıda tekrarlanıyor.A string or object consisting of the specified character repeated the specified number of times.
Özel durumlar
Number 0 ' dan küçük veya Character tür geçerli değil.Number is less than 0 or Character type is not valid.
Character, Nothing değeridir.Character is Nothing.
Örnekler
Bu örnek, StrDup yinelenen karakterlerin bir dizesini döndürmek için işlevini kullanır.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))
Açıklamalar
Bu işlev, yinelenen karakterlerden oluşan bir sonuç döndürür String .This function returns a String made up of repeated characters. Dizeyi oluşturan karakter, Character bağımsız değişkenin ilk karakteridir ve yinelenen sayı olarak yinelenir Number .The character that makes up the string is the first character in the Character argument, and it is duplicated Number number of times.
Ayrıca bkz.
Şunlara uygulanır
StrDup(Int32, String)
Belirtilen karakterin belirtilen sayıda yinelenmesinden oluşan bir dize veya nesne döndürür.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
Parametreler
- Number
- Int32
Gereklidir.Required. Integer ifadesini.Integer expression. Döndürülecek dizenin uzunluğu.The length to the string to be returned.
- Character
- String
Gereklidir.Required. Herhangi bir geçerli Char , String veya Object ifadesi.Any valid Char, String, or Object expression. İfadenin yalnızca ilk karakteri kullanılacaktır.Only the first character of the expression will be used. Karakter türü ise, ya Object da Char bir String değer içermelidir.If Character is of type Object, it must contain either a Char or a String value.
Döndürülenler
Belirtilen karakterden oluşan bir dize veya nesne, belirtilen sayıda tekrarlanıyor.A string or object consisting of the specified character repeated the specified number of times.
Özel durumlar
Number 0 ' dan küçük veya Character tür geçerli değil.Number is less than 0 or Character type is not valid.
Character, Nothing değeridir.Character is Nothing.
Örnekler
Bu örnek, StrDup yinelenen karakterlerin bir dizesini döndürmek için işlevini kullanır.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))
Açıklamalar
Bu işlev, yinelenen karakterlerden oluşan bir sonuç döndürür String .This function returns a String made up of repeated characters. Dizeyi oluşturan karakter, Character bağımsız değişkenin ilk karakteridir ve yinelenen sayı olarak yinelenir Number .The character that makes up the string is the first character in the Character argument, and it is duplicated Number number of times.