約118件1ページ目

日本語のみで絞り込む

2009/8/5 -repeated = new String(new char[n]).replace("\0", s);. Where n is the number of times you want to repeat the string and ...

2025/12/23 -The repeat() method in Java is used to create a new string by repeating the original string a specified number of times.

2024/1/8 -We'll iterate through a for loop N times appending the repeated character: StringBuilder builder = new StringBuilder(N); for (int i = 0; i < N; ...

2024/11/24 -The repeat() method is a straightforward way to duplicate a string multiple times. Here's its method signature: public String repeat(int count).

2014/10/9 -I'm looking for a simple commons method or operator that allows me to repeat some string n times. I know I could write this using a for loop, ...

2026/10/10 -Repeat a string N times in Java with String.repeat(), StringBuilder.repeat(), String.join() with nCopies, Java 8 loops and StringUtils, ...

2022/8/23 -We're going to use a for loop to repeat the string n times. We'll use a char[] array to store the repeated string. Then we'll use the CopyTo ...

2026/10/26 -The repeat() method of String values constructs and returns a new string which contains the specified number of copies of this string, ...

The repeat() method returns a string with a number of copies of a string. The repeat() method returns a new string. The repeat() method does not change the ...

The easiest way in Java is to use a loop or `String.repeat(n)` in Java 11+. For older Java versions, you can push the string into an array and join it, ...