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

Split fails on word boundaries

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 3.x
    • None
    • lang.*
    • None
    • Produced on v3.7 with Java 8, running Windows. But this may be produced in any environment

    Description

      StringUtils.split does not behave correctly when the split is to be performed on word boundary characters ("\b"). Steps to produce the bug:

      String string = "foo<bar>foofoo";
      String[] st=StringUtils.split(string, "\b");

      Expected o/p:

      foo
      <
      bar
      >
      foofoo

       

      Actual o/p:

      foo<bar>foofoo

      The issue seems to be with how zero-width separators are being handled. Note that Java library's String.split gives the expected output.

      Thanks.

      Attachments

        Activity

          People

            Unassigned Unassigned
            devson devson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: