I need to replace last word from input value
Im using this code,
Get_value =$(input).val();
new_word= "new word";
function ReplaceLastWord(Get_value, new_word) {
return Get_value.replace(/\w*$/, new_word);
}
$(input).val(ReplaceLastWord(Get_value, new_word));
Its working, but only for english... i am using tamil laguage in input
$(input).val()="கோச்மேடிக்ஸ் ச்னக்க்ஸ்";
For this language i need use this code.