trim search before searching
This commit is contained in:
parent
1a5af45afb
commit
8865cc406c
|
@ -145,10 +145,10 @@ public class Contact implements ListItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean match(String needle) {
|
public boolean match(String needle) {
|
||||||
if (needle == null) {
|
if (needle == null || needle.isEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
needle = needle.toLowerCase();
|
needle = needle.toLowerCase().trim();
|
||||||
String[] parts = needle.split("\\s+");
|
String[] parts = needle.split("\\s+");
|
||||||
if (parts.length > 1) {
|
if (parts.length > 1) {
|
||||||
for(int i = 0; i < parts.length; ++i) {
|
for(int i = 0; i < parts.length; ++i) {
|
||||||
|
|
Loading…
Reference in a new issue