Practice ยท 3 of 4
Repeat a string
CHALLENGE
Difficulty: beginner+25 XP
Implement static string Repeat(string s, int times) โ s concatenated times times. Repeat("ab", 3) is "ababab"; times of 0 (or negative) yields "". Null input yields "" too.
Press Submit to check your solution.
Back to lesson: Practice: Method workshop