0
Q:

how to check if a string contains a character

if (string.contains(character)
0
public static boolean containsIgnoreCase(String str, char c) {
        str = str.toLowerCase();

        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) == Character.toLowerCase(c)) {
                return true;
            }
        }
        
        return false;
    }
0

New to Communities?

Join the community