while (count>0 && (val[begin+count-1] == ' ' || val[begin+count-1] == '\t')) count--;
    public String getString(String terminals)    {        skipWhiteSpace();        char[] val = value;        int cur = cursor;        if (cur < max)        {            if (val[cur] == '\"')  /* if a quoted string */            {                cur++;               /* skip quote */                char c = '\0';                int begin = cur;                for ( ;cur < max; cur++)                {                    c = val[cur];                    if (c == '\"')                    {                        break;                    }                }                int count = cur-begin;                if (c == '\"')                {                    cur++;                }                cursor = cur;                if (count > 0)                {                    skipWhiteSpace();                    return(new String(val, begin, count));                }            }            else    /* not a quoted string; same as token */            {                int begin = cur;                for ( ;cur < max; cur++)                {                    char c = val[cur];                    if (c=='\"') {                        // but there could be a quoted string in the middle of the string                        cur = cur+skipQuotedString(val,cur);                    } else if ((c == ' ') || (c == '\t') || (terminals.indexOf(c) != -1)) {                        break;                    }                }                cursor = cur;                int count = cur-begin;                if (count > 0)                {                    skipWhiteSpace();                    return(new String(val, begin, count));                }            }        }        return(null);    }