Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exercise: Implement function to repeate a string

  • Implement a function that receives a reference to a string and an integer number and returns the string repeated N times:
repeat("abc_", 3)  returns abc_abc_abc_

Make sure we can accept any integer.