java get string first char code example
Example 1: get first 5 characters of string java
firstFourChars = input.substring(0, 4);
Example 2: java get first char
char fourth = "Banana".charAt(3);
firstFourChars = input.substring(0, 4);
char fourth = "Banana".charAt(3);