Last active
August 29, 2015 14:10
-
-
Save tag1216/4ce8c5c0d8d60e818d77 to your computer and use it in GitHub Desktop.
指定文字列をn回繰り返す
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String repeat(String value, int count) { | |
return IntStream.range(0, count) | |
.collect(StringBuilder::new, (sb, x) -> sb.append(value), StringBuilder::append) | |
.toString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment