Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8302323 Add repeat methods to StringBuilder/StringBuffer
  3. JDK-8315386

Release Note: New `StringBuilder` and `StringBuffer` `repeat` Methods

XMLWordPrintable

      The methods `public StringBuilder repeat(int codePoint, int count)` and `public StringBuilder repeat(CharSequence cs, int count)` have been added to `java.lang.StringBuilder` and `java.lang.StringBuffer` to simplify the appending of multiple copies of characters or strings. For example, `sb.repeat('-', 80)` will insert 80 hyphens into the value of the `java.lang.StringBuilder sb` object.

            jlaskey Jim Laskey
            jlaskey Jim Laskey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: