how to test if a string has certain characters code example Example: java if string contains character if (string.contains(character)