Javascript chop/slice/trim off last character in string -
i have string 12345.00 return 12345.0
i have looked @ trim looks trim whitespace , slice don't see how work. suggestions ?
you can use substring function:
var str = "12345.00"; str = str.substring(0, str.length - 1); this accepted answer, per conversations below, slice syntax clearer:
var str = "12345.00"; str = str.slice(0, -1);
Comments
Post a Comment