How to repeat a set of characters

前端 未结 3 454
醉话见心
醉话见心 2021-01-17 10:11

I\'d like to repeat a set of characters multiple times. I know how to do it with a single character:

string line = new string(\'x\', 10);

3条回答
  •  花落未央
    2021-01-17 10:54

    A slight variation on the answer by Bala R

    var s = String.Concat(Enumerable.Repeat("-.", 10));
    

提交回复
热议问题