create a function that returns the first index of a character in a string
Anonymous
int charPosn(String str, char ch) { for (int i = 0; i < str.length; i++) { if (str.charAt(i) == ch) return i; } return -1; }
Check out your Company Bowl for anonymous work chats.