how to get first 4 characters of a string in java. 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);