java if something in string code example
Example 1: check if a string contains a character java
string.indexOf('a')
Example 2: java if string contains character
if (string.contains(character)
string.indexOf('a')
if (string.contains(character)