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

Code Example 1

var str = "Hello";
var newString = str.substring(0, str.length - 1); //newString = Hell

Code Example 2

String string = "Hello World";

//Remove first character
string.substring(1); //ello World

//Remove last character
string.substring(0, string.length()-1); //Hello Worl

//Remove first and last character
string.substring(1, string.length()-1); //ello Worl

Code Example 3

private static String removeLastChar(String str) {
    return str.substring(0, str.length() - 1);
}

Learn ReactJs, React Native from akashmittal.com