A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
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?
"foo".equals(foo) vs foo.equals("foo")
is the search case sensitive?
Not case sensitive boolean
Collections key comparison in case-insensitive
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014