United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6189137 : new String convenience methods isEmpty() and contains(String)

Details
Type:
Enhancement
Submit Date:
2004-11-02
Status:
Resolved
Updated Date:
2012-01-11
Project Name:
JDK
Resolved Date:
2004-12-04
Component:
core-libs
OS:
generic
Sub-Component:
java.lang
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports

Sub Tasks

Description
The java.lang.String class would benefit from a couple of very simple
convenience methods that capture two very common use cases:

    boolean isEmpty() { return length() == 0; }
    boolean contains(String s) { return indexOf(s) >= 0; }
###@###.### 11/2/04 00:10 GMT

                                    

Comments
EVALUATION

String.contains(String) is subsumed by the method contains(CharSequence) which
was added in Tiger.

###@###.### 11/2/04 00:26 GMT

String.isEmpty() added to mustang, b15.

###@###.### 2005-05-16 17:19:12 GMT
                                     
2004-11-02



Hardware and Software, Engineered to Work Together