use substring:

if (c1plnt.length() >= 3)
        check_this_string = c1plnt.substring(0, 3);

> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> Jeetandra Mahtani
> Sent: Thursday, April 22, 1999 8:12 AM
> To: [EMAIL PROTECTED]
> Subject: Getting part of a string
>
>
> Hello,
> Can someone tell me how to get the following method
> of String to work
> String(char [], int, int)
> basically I have a form with several fields and I am
> trying to validate some of the fields.
> eg I am getting  a value as
> String c1plnt = req.getParameterValues("C1PLNT")[0];
> basically I just need the first three characters of
> the parameter.
> Any suggestion?
> Thanks,
> J
>
>
>
>
>
> _________________________________________________________
> DO YOU YAHOO!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
> __________________________________________________________________
> _________
> 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