Typescript Variable In String Javascript Substring Method