aspose file tools
The moose likes Beginning Java and the fly likes Comparing Strings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Comparing Strings" Watch "Comparing Strings" New topic
Author

Comparing Strings

Daniel Roman
Greenhorn

Joined: Jan 24, 2004
Posts: 4
I want to write a method that should return true if it refers to a String object that is the same . Otherwise, the method should return false.
Any suggestions ??
Vicken Karaoghlanian
Ranch Hand

Joined: Jul 21, 2003
Posts: 522

if you want to compare regardless to the string case (upper or lower) then use s1.equalsIgnoreCase(s2)


- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: Comparing Strings