javascript replace last character
var str1 = "Notion,Data,Identity,".replace(/.$/,".")
javascript replace last character
var str1 = "Notion,Data,Identity,".replace(/.$/,".")
javascript replace last occurrence of a letter
String.prototype.replaceLast = function (search, replace) {
return this.replace(new RegExp(search+"([^"+search+"]*)$"), replace+"$1");
}
str = "lala";
newStr = str.replaceLast("l", "m");
console.log(newStr);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us