matches two string Ignore Case - Android java.lang

Android examples for java.lang:String Match

Description

matches two string Ignore Case

Demo Code

import android.text.TextUtils;
import java.util.ArrayList;
import java.util.List;

public class Main{

    private static boolean matchesIgnoreCase(String str, String query,
            int startingAt) {
        int len = query.length();
        for (int i = 0; i < len; i++) {
            if (Character.toUpperCase(query.charAt(i)) != Character
                    .toUpperCase(str.charAt(startingAt + i))) {
                return false;
            }//from   w  ww  .java 2s  . c  o  m
        }
        return true;
    }

}

Related Tutorials