IgnoreCaseComp.java Source code

Java tutorial

Introduction

Here is the source code for IgnoreCaseComp.java

Source

import java.text.Collator;
import java.util.Comparator;

class IgnoreCaseComp implements Comparator<String> {
    Collator col;

    IgnoreCaseComp() {
        col = Collator.getInstance();

        col.setStrength(Collator.PRIMARY);
    }

    public int compare(String strA, String strB) {
        return col.compare(strA, strB);
    }
}