you might also want to check if there are any trailing space characters
in the string you're checking.
try:
if( string.trim().equals( "string" ) ) { do something }
-----Original Message-----
From: Nicholas Larsson [mailto:[EMAIL PROTECTED]]
Sent: 22. ma� 2001 12:05
To: [EMAIL PROTECTED]
Subject: String as parameter
Hi
Have a problem. I pass a value fetched from a combo box with the post
method.
I then use request.getParameter to store the String in a new string
member.
When I evaluate the string with if(string.equals("string")) it doesn't
return true even if it contains exactly the same string.
Anyone know why?
/Nico
========================================================================
===
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