Language

StringBuilder.Repeat Method

Definition

Overloads

Name Description
Repeat(String, Int32)

Appends the requested number of copies of the supplied text.

Repeat(ICharSequence, Int32)

Appends count copies of the specified CharSequence cs to this sequence.

Repeat(Int32, Int32)

Repeats count copies of the string representation of the codePoint argument to this sequence.

Repeat(String, Int32)

Appends the requested number of copies of the supplied text.

public Java.Lang.StringBuilder Repeat(string cs, int count);
member this.Repeat : string * int -> Java.Lang.StringBuilder

Parameters

cs
String

The text to append repeatedly. A null value supplies the four-character text "null".

count
Int32

The number of copies to append; must be zero or greater.

Returns

This builder instance after the append.

Remarks

This overload passes the string as a Java character sequence. A zero count leaves the content unchanged; a negative count causes IllegalArgumentException. For a null string and a positive count, each copy is the text null.

Applies to

Repeat(ICharSequence, Int32)

Appends count copies of the specified CharSequence cs to this sequence.

[Android.Runtime.Register("repeat", "(Ljava/lang/CharSequence;I)Ljava/lang/StringBuilder;", "", ApiSince=37)]
public Java.Lang.StringBuilder Repeat(Java.Lang.ICharSequence cs, int count);
[<Android.Runtime.Register("repeat", "(Ljava/lang/CharSequence;I)Ljava/lang/StringBuilder;", "", ApiSince=37)>]
member this.Repeat : Java.Lang.ICharSequence * int -> Java.Lang.StringBuilder

Parameters

cs
ICharSequence

a CharSequence

count
Int32

number of times to copy

Returns

a reference to this object.

Attributes

Remarks

Appends count copies of the specified CharSequence cs to this sequence. The length of this sequence increases by count times the CharSequence length. If cs is null, then the four characters "null" are repeated into this sequence.

Java reference for java.lang.StringBuilder.repeat.

Applies to

Repeat(Int32, Int32)

Repeats count copies of the string representation of the codePoint argument to this sequence.

[Android.Runtime.Register("repeat", "(II)Ljava/lang/StringBuilder;", "", ApiSince=37)]
public Java.Lang.StringBuilder Repeat(int codePoint, int count);
[<Android.Runtime.Register("repeat", "(II)Ljava/lang/StringBuilder;", "", ApiSince=37)>]
member this.Repeat : int * int -> Java.Lang.StringBuilder

Parameters

codePoint
Int32

code point to append

count
Int32

number of times to copy

Returns

a reference to this object.

Attributes

Remarks

Repeats count copies of the string representation of the codePoint argument to this sequence. The length of this sequence increases by count times the string representation length. It is usual to use char expressions for code points. For example: Copy

Java reference for java.lang.StringBuilder.repeat.

Applies to