public static void main(String[] args) {
String url = "abc@gmail.com";
char key = '@';
char[] ch = url.toCharArray();
for (int i = 0; i < ch.length; i++) {
if (key == ch[i]) {
System.out.println(key + " is in index: "+i);
}
}
}