id/email
password
forgot password
about | help | done | prefs | create account
JavaBat java practice problems

String-2 > repeatEnd
prev  |  next  |  chance

Given a string and an int N, return a string made of N repetitions of the last N characters of the string. You may assume that N is between 0 and the length of the string, inclusive.

repeatEnd("Hello", 3) → "llollollo"
repeatEnd("Hello", 2) → "lolo"
repeatEnd("Hello", 1) → "o"

...Save, Compile, Run

See Also: Example Code Java help: If Boolean Logic | Strings | While and For Loops | Arrays and Loops


prev  |  next  |  chance   |  JavaBat  >  String-2

Forget It! -- delete my code for this problem 230.0

Copyright Nick Parlante 2006-09 - privacy