Small improvement

This commit is contained in:
M66B 2019-10-04 16:18:43 +02:00
parent 930921f500
commit 264b957c73
1 changed files with 8 additions and 4 deletions

View File

@ -69,11 +69,15 @@ public class EntityAnswer implements Serializable {
if (fullName != null) {
fullName = fullName.trim();
int c = fullName.lastIndexOf(",");
if (c < 0)
c = fullName.lastIndexOf(" ");
if (c > 0) {
first = fullName.substring(0, c).trim();
last = fullName.substring(c + 1).trim();
last = fullName.substring(0, c).trim();
first = fullName.substring(c + 1).trim();
} else {
c = fullName.lastIndexOf(" ");
if (c > 0) {
first = fullName.substring(0, c).trim();
last = fullName.substring(c + 1).trim();
}
}
}