A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Software Craftsman
this week in the
compare strings case insensitive?
Joined: May 12, 2005
Jun 14, 2006 10:27:00
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
Joined: Feb 02, 2001
Jun 14, 2006 10:34:00
you convert both
to upper (or lower) case and compare
It is sorta covered in the
JavaRanch Style Guide
subject: compare strings case insensitive?
Why 2 interfaces Comparable and Comparator?
is the search case sensitive?
"foo".equals(foo) vs foo.equals("foo")
Collections key comparison in case-insensitive
Not case sensitive boolean
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015