java remove last character from string

208

check last character of string java -

String str = "India";
System.out.println("last char = " + str.charAt(str.length() - 1));

remove last character from string -

let str = "12345.00";
str = str.substring(0, str.length - 1);

remoce last character froma java string -

str = str.substring(0, str.length() - 1);

Comments

Submit
0 Comments