check a string contain a or not in java code example Example: java if string contains character if (string.contains(character)