Replace All In String Javascript Substring Method