JDK-6189137 : new String convenience methods isEmpty() and contains(String)
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-11-02
  • Updated: 2017-05-16
  • Resolved: 2004-12-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
JDK 6
6 b15Fixed
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