Array Contains String Javascript Substring Replace