public ArrayList<String> split(String str) {
        str = str.trim();
        String[] arr = str.split(" ");
        ArrayList<String> ans = new ArrayList<String>();
        for (int i = 0; i < arr.length; ++i) {
            if (arr[i].charAt(0) == '\"') {
                String temp = "";
                temp += arr[i++] + " ";
                while (i < arr.length && arr[i].charAt(arr[i].length() - 1) != '\"') {
                    temp += arr[i++] + " ";
                }
                temp += arr[i];
                ans.add(temp);
            } else {
                ans.add(arr[i]);
            }
        }
        return ans;
    }