java function to check wheather a string contains a character or not 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)