Jump to content

Repeat a string: Difference between revisions

→‎{{header|Java}}: no functions in Java
(→‎{{header|Java}}: no functions in Java)
Line 458:
{{works with|Java|1.5+}}
 
There's no functionmethod or operator to do this in Java, so you have to do it yourself.
<lang java5>public static String repeat(String str, int times){
StringBuilder ret = new StringBuilder();
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.