string class : Repeat(int) method

Description

Gets a new instance of the string that have repeated the invoker string.

Syntax

stringInstance.Repeat(int numberOfTimes)

Arguments

ClassNameDescription
intnumberOfTimesThe number of repetitions.

Return value

ClassDescription
stringA new instance of the string that have repeated the invoker string.

Sample code

//anyString is a instance of string type.

string repeatedString = anyString.Repeat(5);

Notes

None

Links for reference

None

Copyright © Rice All rights reserved.