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

Add a method in StringUtils to extract only digits out of input string

    XMLWordPrintableJSON

Details

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

    Description

      This method will check if the input String contains Unicode digits, if yes then concatenate all the digits and return it as a single String.

      Examples:
      StringUtils.getDigits(null) = null
      StringUtils.getDigits("") = ""
      StringUtils.getDigits("abc") = ""
      StringUtils.getDigits("1000$") = "1000"
      StringUtils.getDigits("1123~45") = "12345"
      StringUtils.getDigits("(541) 754-3010") = "5417543010"
      StringUtils.getDigits("\u0967\u0968\u0969") = "\u0967\u0968\u0969"

      Attachments

        Issue Links

          Activity

            People

              pascalschumacher Pascal Schumacher
              arshad0789 Arshad Basha
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: