Typescript Remove Last Element Of A String