Answers for "string to number cut last 2 char js"

3

remove last 3 characters from string javascript

str = str.slice(0, -3);
Posted by: Guest on April-06-2020
1

js split last occurence

var lastIndex = src.lastIndexOf('.');

  // Add the string before the last .
  // Return updated string, this will update the src attribute value
  return src.substr(0, lastIndex) + '-fx' + src.substr(lastIndex);
Posted by: Guest on December-04-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language