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 190 views
1 answer 198 views
1 answer 204 views
1 answer 215 views
1 answer 280 views
1 answer 251 views
...