In C#, there is no such operator as in per or Python where you can easily repeat a string n times. But no worry, there is way that you can easily tot make the String to have thei function to repeat the string n times.
here is the code
public static class StringExtensions
{
public static string Repeat(this char charToRepeat, int repeat)
{
return new string(charToRepeat, repeat);
}
public static string Repeat(this string stringToRepeat, int repeat)
{
var builder = new StringBuilder(repeat * stringToRepeat.Length);
for (int i = 0; i < repeat; i++)
{
builder.Append(stringToRepeat);
}
return builder.ToString();
}
}