Is there a function in C# that returns x times of a given char or string? Or must I code it myself?
49
votes
this is not an exact duplicate: this is a way to do it. Dim line As String = New [String]("-"c, 100)
– KevinDeus
Well, better late than never. I voted for re-opening this as it is not a duplicate of linked possible duplicate. Best way to repeat a character in C# does not cover repeating strings but only characters!
– Nope
possible duplicate of Can I "multiply" a string (in C#)?
– Deanna
possible duplicate of Is there an easy way to return a string repeated X number of times?
– Pekka
5 Answers
60
votes
30
votes
3
votes