Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 308 Bytes

7 kyu Thinkful - String Drills: Repeater.md

File metadata and controls

15 lines (12 loc) · 308 Bytes

Task

Write a class function named repeat() that takes two arguments (a string and a long integer), and returns a new string where the input string is repeated that many times. For example:

Repeater.repeat("a", 5) should return

"aaaaa"

My solution

def repeater(string, n)
  string * n
end