Answers for "remove last 2 characters from string"

75

js remove last character from string

let str = "Hello Worlds";
str = str.slice(0, -1);
Posted by: Guest on January-16-2020
6

remove last character from string

let str = "12345.00";
str = str.substring(0, str.length - 1);
Posted by: Guest on September-02-2020
5

string remove last character

public static String removeLastCharacter(String str) {   
	String result = null;   
    if ((str != null) && (str.length() > 0)) {      
    	result = str.substring(0, str.length() - 1);   
    }   
    
    return result;
}
Posted by: Guest on March-30-2020
0

kotlin string remove last 3 digits

str.substring(0, str.length() - 2);
Posted by: Guest on April-16-2020
0

remove last charecter from string

buggy_name = 'GeekflareE'
name = buggy_name[:-1]
Posted by: Guest on October-21-2021

Code answers related to "remove last 2 characters from string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language