or, if you want a single char variable and know the String is only 1 char in
length before hand:
char myChar = myString.charAt(0);
I recommend you get used to checking the javadocs for stuff like this, it
will save you a lot of time. Just look up the class name and you'll find
what you need:
http://java.sun.com/j2se/1.3/docs/api/index.html
cheers,
Paul
> -----Original Message-----
> From: Ron Chan [mailto:[EMAIL PROTECTED]]
> Sent: 20 September 2001 12:26
> To: [EMAIL PROTECTED]
> Subject: Re: string to char
>
>
> javadocs for String:
>
> toCharArray
>
> public char[] toCharArray()
>
> Converts this string to a new character array.
>
> Returns:
> a newly allocated character array whose length is
> the length of this string and whose contents are
> initialized to contain the character sequence
> represented by this string.
>
>
>
>
> --- KL OOI <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > sorry for the off topic here, how to convert a
> > string to char ??
> >
> > thanks..
> >
> > regards,
> > kl
> >
> >
> >
> _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at
> > http://mail.yahoo.com
> >
> >
> >
> ==============================================================
> =============
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> > body: "signoff JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body:
> > "set JSP-INTEREST DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
> __________________________________________________
> Terrorist Attacks on U.S. - How can you help?
> Donate cash, emergency relief information
> http://dailynews.yahoo.com/fc/US/Emergency_Information/
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets