In C#, as inputs i have:
Letter: "A"
Length: 5
and i want to output:
"AAAAA"
Is there a more elegant way of doing this besides loop?
You can use string constructor: new string('A', 5);
You could just just the character repeating String constructor to create the String.
Console.WriteLine(new String('A', 5));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With