check if character present in string java code example
Example 1: how to check if there is a character in a string java
String.contains()
Example 2: check if a string contains a character java
string.indexOf('a')
Example 3: java if string contains character
if (string.contains(character)