Repeat a character x times with c#

Hey everyone,

Just a neat little trick I came across on Stackoverflow, repeating a character x times without using a loop:

string result = new String(‘x’, 5); //xxxxx
string result = new String(‘a’, 3); //aaa

Check out the original post for more info:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.