This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes compare strings case insensitive? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "compare strings case insensitive?" Watch "compare strings case insensitive?" New topic
Author

compare strings case insensitive?

reubin haz
Ranch Hand

Joined: May 12, 2005
Posts: 287
I want to compare and search strings case insensitively. But I only see code that use indexOf() or comparison signs for comparing, which is case sensitive. Is there any methods or ways to do the comparison which is case insensitive?


SCJA, SCJP5.0, SCBCD, SCWCD
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
you convert both string to upper (or lower) case and compare
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: compare strings case insensitive?
 
Similar Threads
Collections key comparison in case-insensitive
Why 2 interfaces Comparable and Comparator?
is the search case sensitive?
Not case sensitive boolean
"foo".equals(foo) vs foo.equals("foo")