I'd like to create a function that has the following signature:
public String createString(int length, char ch)
It should return a string of repeating characters of the specified length.
For example if length is 5 and ch is 'p' the return value should be
ppppp
Is there a way to do this without looping until it is the required length?
And without any externally defined constants?