Split String Into Substrings Javascript Format