Attempting to split a string into separated letters
String string1 ="KKXGJRNQGA";
List solutionArray = Arrays.asList(string1.split(""));
will return `[, K, K, X, G, J, R, N, Q, G, A]` before each alphabet a space and at [0] is an empty element.
But actually i want is `[K,K,X,G,J,R,N,Q,G,A]`, is there a way to solve it? can using regex match?
以上就是Split a string into array without empty element的详细内容,更多请关注web前端其它相关文章!