Here is a method that I have written in one of my classes.
Send me a $25 certificate if it helps ;-)

    public Vector stringParser(String str, String delim, int maxLength)
{
  
        Vector strVector = new Vector();
        String token;

        try {
            StringTokenizer st = new StringTokenizer(str, delim);
            while (st.hasMoreTokens()) {                                
                token = st.nextToken();
                if (token.length() > maxLength)
                    token = token.substring(0, maxLength);
                strVector.addElement(token);
            }
        }
        catch (NoSuchElementException nse) {
            return null;
        }
        return strVector;
    }

HY

----------------------------------------------------------------------

kevin1 wrote:
> 
> Hello all,
>         I have a String, which will be a query string from an application.  I want
> to parse it to get at some of the values.  Is there a handy class that will do
> that for me?
> 
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to