I want to be able to repeat a string of text "n" times:
Something like this -
String "X", user input = n, 5 = n, output: XXXXX
I hope this makes sense... (Please be as specific as possible)
str2 = new String(new char[10]).replace("\0", "hello");
note: this answer was originally posted by user102008 here: Simple way to repeat a String in java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With