September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -1,9 +1,10 @@
public static String repeat(String str, int times){
StringBuilder ret = new StringBuilder();
for(int i = 0;i < times;i++) ret.append(str);
return ret.toString();
public static String repeat(String str, int times) {
StringBuilder sb = new StringBuilder(str.length() * times);
for (int i = 0; i < times; i++)
sb.append(str);
return sb.toString();
}
public static void main(String[] args){
System.out.println(repeat("ha", 5));
public static void main(String[] args) {
System.out.println(repeat("ha", 5));
}

View file

@ -1,3 +1,3 @@
public static String repeat(String str, int times){
public static String repeat(String str, int times) {
return new String(new char[times]).replace("\0", str);
}