I am trying to parse the arguments for a command, but if I were to put a few spaces in a string, String.split () would leave empty strings in the result array. Is there any way to get rid of this?
For example: "abc 123".split(" ")leads to {"abc", "", "", "", "", "123"}, but I really want{"abc", "123"}
source
share