Answers for "get only first character string java"

8

get first character of string java

var string = "freeCodecamp";

string.charAt(0); // Returns "f"
Posted by: Guest on December-14-2019
0

java first character string number

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");
}
Posted by: Guest on February-10-2022

Code answers related to "get only first character string java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language