Repeat the Last Characters

Sum of digits in a number

Write an application that prompts for and reads a String followed by an integer then returns a string made of x repetitions of the last x characters of the string.

Example 1:


input data:
tester 5
output:
esteresteresteresterester

Example 2:


input data:
hello 3
output:
llollollo
View Java Solution

Seda
Seda Kunda is a web designer and developer with a degree in Computer Science and a great passion for code. Besides code, she enjoys pepperoni pizza, watching the bachelor and sleeping in on Saturdays.
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn