Java Split String By Character Into Array In Javascript Functions