Use Variable Inside String Javascript Substring Indexof Java