I'm studying Java recently.
Is there any way to make a string from char with N-times?
C#: string str = new string('A', 30);
Java: ???
please help me. Thank you
What version of java are you using?
If Java 8
String.join("", Collections.nCopies(n, s));
If Java 11
"abc".repeat(12);
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments