Typescript Remove Last Element In String