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

StringUtils: Include methods for appending suffix or prepending a prefix if not already present

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1
    • 3.2
    • lang.*
    • None

    Description

      StringUtils has various methods to checking and removing a substring from the start/end of a string but nothing for appending. These methods will append a suffix to the end or prepend a prefix to the start of the string if not already present.

      The methods would include:

      • appendIfMissing
      • appendIfMissingAny
      • appendIfMissingIgnoreCase
      • appendIfMissingAnyIgnoreCase
      • prependIfMissing
      • prependIfMissingAny
      • prependIfMissingIgnoreCase
      • prependIfMissingAnyIgnoreCase

      Attachments

        1. LANG-875.patch
          21 kB
          Joanne Polsky
        2. LANG-875-2.patch
          7 kB
          Joanne Polsky
        3. LANG-875-noany.patch
          18 kB
          Joanne Polsky

        Activity

          People

            Unassigned Unassigned
            jpolsky Joanne Polsky
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: