Problem: String Repeater

Create a method RepeatString(str, count), which takes parameters of type string and an integer n and returns the string, repeated n times. After this print the result on the console.

Sample Input and Output

Input Output Input Output
strstr roki

Hints and Guidelines

In the method below, inside the loop, append the input string to the result, that you will finally return:

Keep in mind that in C# concatenating strings in loops leads to bad performance and is not recommended. Learn more at:

Look for more effective solutions here:

Testing in the Judge System

Test your solution here:

results matching ""

    No results matching ""