Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to repeat string in java

FOR JAVA 8 :

import static java.util.stream.Collectors.joining;
import static java.util.stream.Stream.generate;

String repeat(int count) {
 
    return Stream.generate(() -> "ABC").limit(count).collect(Collectors.joining());
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #repeat #string #java
ADD COMMENT
Topic
Name
8+7 =