To extract a single character from a String, we can refer directly to an individual character via the charAt( ) method. It has this general form
char charAt(int where)
char ch;
ch = “abc”.charAt(1);
assigns the value “b” to ch
To extract a single character from a String, we can refer directly to an individual character via the charAt( ) method. It has this general form
char charAt(int where)
char ch;
ch = “abc”.charAt(1);
assigns the value “b” to ch