結果 : replace last occurrence of character in string javascript