How to split a string with whitespace chars at the beginning?

后端 未结 4 823
青春惊慌失措
青春惊慌失措 2021-01-12 14:43

Quick example:

public class Test {
    public static void main(String[] args) {
        String str = \"   a b\";
        String[] arr = str.split(\"\\\\s+\")         


        
4条回答
提交回复
热议问题