java check if string does not contains characters code example Example: java if string contains character if (string.contains(character)