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