you can use string constructor that accepts a char and the number of times to repeat it.
Example:
public class Program
{
public static void Main()
{
string tabs = new String('X', 4);
Console.WriteLine(tabs);
}
}
OUTPUT:
XXXX
Example:
public class Program
{
public static void Main()
{
string tabs = new String('X', 4);
Console.WriteLine(tabs);
}
}
OUTPUT:
XXXX
No comments:
Post a Comment