on 10-08-2007 2:35 PM
Hi,
I am using the TableFilter.java file to filter the enteries in the table. But the problem is, the results are case sensitive. So i tried adding the following lines of code
<b>if(o1 instanceOf String && o2 instanceOf String){
String s1 = o1.toString();
String s2 = o2.toString();
return s1.compareToIgnoreCase(s2);
}</b>
just before the return statement in
private static final Comparator DEFAULT = new Comparator()
But still the filter is case sensitive.
Can you help me make it case in sensitive
Regards,
Prathamesh
Hi
Try with this
s1.toUpperCase().compareToIgnoreCase(s2.toUpperCase());
Regards
Abhijith YS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
in your compare program you can use:
string.equalsIgnoreCase(anotherString)
This will definitely work.
Feel free for any queries.
Regard,
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you sure that all data is of type String ? Check that first.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.