How to create a string by repeating a character in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string s = new string('W', 10);

        Console.Write(s);
    }
}



/*
run:

WWWWWWWWWW

*/

 



answered Nov 13, 2021 by avibootz

Related questions

1 answer 194 views
1 answer 191 views
1 answer 199 views
1 answer 205 views
1 answer 215 views
1 answer 281 views
1 answer 252 views
...