Js Replace Last Character