I need to use an indexof method but terminal is telling me that it needs a variable but it gets a value. Can you guys explain how I fix this?
This is what I came up with by myself.
char a = 'a';
if (s.indexOf(a, s.length()) == 61)
System.out.println(" Your string contains the letter 'a' at index position: " + s.indexOf(97));
else
System.out.println(" Your string does not contain the letter 'a'");