Check out example codes for "get first character of string java". It will help you in understanding the concepts better.

Code Example 1

var string = "freeCodecamp";

string.charAt(0); // Returns "f"

Code Example 2

String str = "Grepper";
char ch = str.charAt(0);
//ch is assigned the value of G

Learn ReactJs, React Native from akashmittal.com