JDK-4124769 : String should have case insensitive comparison
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1998-04-01
  • Updated: 1999-01-15
  • Resolved: 1999-01-15
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 Availability Release.

To download the current JDK release, click here.
Other
1.2.0 1.2beta4Fixed
Description
Problem:
  Sorts of Strings are just as likely to be done in a case insensitive manner
  as in a case sensitive one, yet the String class has no case insensitive
  Comparator or compareTo method.
 
Requestors: 
  Internal

Proposed API change:
   Add to class String the following operation and constant to support
   case-insensitive sorting with the new collections APIs:

  1. public int compareToIgnoreCase(String other)
     This addition fills out existing comparison and sorting methods:

	    OP:	equality		sorting
	MODE	--------		-------
	exact|	equals			compareTo
	C.I. |	equalsIgnoreCase	compareToIgnoreCase[NEW]

  2. public static final Comparator CASE_INSENSITIVE_ORDER
     Comparator which calls compareToIgnoreCase, for use with Arrays.sort, etc.

  Notes:
  - These respect the current locale setting.
  - They may be defined in terms of toLowerCase and compareTo.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic FIXED IN: 1.2beta4 INTEGRATED IN: 1.2beta4
14-06-2004

EVALUATION compareToIgnoreCase and Comparator CASE_INSENSITIVE_ORDER have been added to java.lang.String. To get this functionality in some locales it may be necessary to use java.text.Collator instead. michael.mccloskey@eng 1998-04-24
24-04-1998