Typescript Change Last Element Of String