dcsimg
 

Submitted by: Srinath M S(srinath_ms@yahoo.com)

Tuesday Oct 3rd 2017 by Srinath M S

Language: .NET, Expertise: Intermediate - Use the string class's constructor to specify the character and the number of times you want it to be repeated.

Use the string class's constructor to specify the character and the number of times you want it to be repeated.

Listing 1. Repeat String Characters

String repeatedCharacterString = new String('*',50);

The sample code will create a string of 50 repeated '*' characters.

Home
Mobile Site | Full Site