user StringTokenizer

myword ="test1;test2;test3";
StringTokenizer st = new StringTokenizer(myword ";");

String word1 = st.nextToken(); //this will give you test1
String word2 = st.nextToken();//this will give you test2



good luck

-cl


> -----Original Message-----
> From: N Jawahar [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, September 26, 2000 12:11 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: managing a string
>
> hi,
>
> give me an example to solve.
>
> njr
>
> -----Original Message-----
> From: Marcos Lloret [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 25, 2000 10:38 PM
> To: [EMAIL PROTECTED]
> Subject: managing a string
>
>
> hi,
>
>     i have a string with some words separated by ;
>
>     i would like to, firstly, take the words before the ';' and put them
> in a new string. secondly taking those words between the ';' and keeping
> them into another string. ....
>
>     how can i do that?
>
> thanks in advance,
>
> marcos
> [EMAIL PROTECTED]
>
> __________________________________________________________________________
> _
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> __________________________________________________________________________
> _
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to