trim search before searching

This commit is contained in:
iNPUTmice 2014-11-17 17:31:26 +01:00
parent 1a5af45afb
commit 8865cc406c

View file

@ -145,10 +145,10 @@ public class Contact implements ListItem {
}
public boolean match(String needle) {
if (needle == null) {
if (needle == null || needle.isEmpty()) {
return true;
}
needle = needle.toLowerCase();
needle = needle.toLowerCase().trim();
String[] parts = needle.split("\\s+");
if (parts.length > 1) {
for(int i = 0; i < parts.length; ++i) {