×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Easily Create a String of Repeated Characters
 

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
Copyright 2018 © QuinStreet Inc. All Rights Reserved