c# how to make numbers show multiple times code example Example: c# repeat string x times string result = new String('-', 5); Output: -----