Improve parsing algorithm to remove empty strings from the String array after the split(" ") function is called