java remove first character from string
var str = "Hello";
var newString = str.substring(0, str.length - 1); //newString = HellString 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 Worlprivate static String removeLastChar(String str) {
return str.substring(0, str.length() - 1);
}
Also in Java:
- contains example in java
- java loop through object
- how to write queries in java
- reentrantreadwritelock java
- convert from integer to character java
- java if statement string equals scanner
- Building a maven EAR project and specifying the configuration of which projects to include, what is the element in the plugin configuration that contains Enterprise Java Bean Projects:
- java file download
- biginteger in java
- Compare integers java sort
- float to string java
- reverse linked list in java to get both head and tail
- java throws multiple exceptions
- spigot cancel repeating task
- spigot action bar
- kotlin jsonobject get nested
- how to remove duplicates from an array java
- how to make a button disapear on click in javafx
- java put a char array into a string
- update value of an arraylist java
- double to string java
- how to crate a list in java script
- java recursion
- java empty array