Nicholas DeFazio created LANG-1161:
--------------------------------------

             Summary: StringUtils.startsWith returns true for an empty string 
comparison
                 Key: LANG-1161
                 URL: https://issues.apache.org/jira/browse/LANG-1161
             Project: Commons Lang
          Issue Type: Improvement
    Affects Versions: 3.3
            Reporter: Nicholas DeFazio
            Priority: Trivial


When working on a project I noticed that...

{code}
        boolean match = StringUtils.startsWith("abcdef", "");
        System.out.println(match); //prints true
{code}

My thought was that a comparison of a non empty string to an empty string 
should result in a false, similar to how null is handled.

{code}
        boolean match = StringUtils.startsWith("abcdef", null);
        System.out.println(match); //prints false
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to