commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 22692] New: - StringUtils.split ignores empty items
Date Mon, 25 Aug 2003 12:16:18 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22692>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22692

StringUtils.split ignores empty items

           Summary: StringUtils.split ignores empty items
           Product: Commons
           Version: 1.0.1 Final
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Lang
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: ludwig@riege.com


StringUtils.split ignores empty items (eg. delimiter at the beginning of the 
string, 2 delimiters directly after another)

Eg.

String[] l = StringUtils.split("X,DE,Germany", ",");
results in 
l[0] = "X"
l[1] = "DE"
l[2] = "Germany"

String[] l = StringUtils.split(",DE,Germany", ",");
results in
l[0] = "DE"
l[1] = "Germany"
expected : 
l[0] = "" (or null ?)
l[1] = "DE"
l[2] = "Germany"

The current behaviour makes it impossible to detect the "column" (eg. for 
parsing .csv files).

Mime
View raw message