Without trying to be rude, this is a mailing list about JavaServer Pages,
not basic java programming. I fail to see how your question even remotely
involves JSP in any manner. Try a Java forum, a few good books, or possibly
a chat channel on Java.


> -----Original Message-----
> From: A mailing list about Java Server Pages specification and
> reference [mailto:[EMAIL PROTECTED]]On Behalf Of Jean Chiang (���Q
�g)
> Sent: Monday, January 01, 2001 9:23 PM
> To: [EMAIL PROTECTED]
> Subject: The comparison between string and char.
>
>
> I am new to JSP. Who is going to help me? Thanks in advance.
> I read some input from a text file and the first parameter is an int and
> others are string. I have to do different action according to the first
> parameter.
> A part of my source code is listed as follows:
>
> In this case, when my first parameter is "1", it still shows "no". What's
> wrong? I suppose it cannot compare char and string. but how can I
> deal with
> this stuff?
>
>
> <%   BufferedReader in = new BufferedReader(
>                          new InputStreamReader(
>                           yc.getInputStream()));
>
>  String inputLine;
>
> if ( inputLine.substring(0,1) == "1" ) {
>    out.println("yes");
>  }
> else {
>     out.println("no");
> }
> %>
>
> ==================================================================
> =========
> 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

Reply via email to