trim search before searching

This commit is contained in:
iNPUTmice 2014-11-17 17:31:26 +01:00
parent 1a5af45afb
commit 8865cc406c
1 changed files with 2 additions and 2 deletions

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) {