How to check if a string contains a value in Java code example Example: java if string contains character if (string.contains(character)