| Developer's Daily | Java Q&A Center |
| main | java | perl | unix | dev directory | web log |
| Question: | How do I compare two Strings to each other? |
| Answer: |
|
Here's the right way to do it: You should use one of the following tests to compare the contents of two strings:
Any of these statements compare the contents of the two strings name
Here's the wrong way to do it: Many times we make the mistake of using the following syntax when comparing strings:
A comparison of objects (such as Strings) using the
|
Copyright
© 1998-2002 DevDaily Interactive, Inc.
All Rights Reserved.