Получите первый символ String Java
var string = "freeCodecamp";
string.charAt(0); // Returns "f"
Red Necked Phalarope
var string = "freeCodecamp";
string.charAt(0); // Returns "f"
String myString = "1253";
if(Character.isDigit(myString.charAt(0))){
System.out.println("First character of string is a number");
}
else{
System.out.println("First character of string is not a number");
}