how to know if a string contains a symbol code example Example: java if string contains character if (string.contains(character)