Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-348

Add StringUtils.repeat with separator

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.5
    • lang.*
    • None

    Description

      I would like to have a repeat method with the ability to set a separator:
      public static String repeat(String str, char separatorChar, int repeat)

      Usage scenario: generate insert statements for JDBC preparedstatements:
      assertEquals("?,?,?,?", StringUtils.repeat("?", ',', 4));

      Can this be added to commons-lang?

      Thanks!

      Attachments

        Activity

          People

            Unassigned Unassigned
            kees-van-dieren Kees van Dieren
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: