LINQのEnumerable.Repeatメソッドを用いることにより、任意の文字列を繰り返した文字列を作成することができます。
同じ文字列を繰り返した文字列を作成する(Repeat)・LINQ版
using System;
using System.Linq;
class Sample {
static void Main()
{
// "あいう"を10回くりかえした文字列を作る
var s = string.Concat(Enumerable.Repeat("あいう", 10));
Console.WriteLine(s);
}
}
実行結果
あいうあいうあいうあいうあいうあいうあいうあいうあいうあいう