pull/209/head
M66B 2 years ago
parent 4d67d89528
commit 197762b9a3

@ -170,6 +170,9 @@ public class EntityAnswer implements Serializable {
}
}
first = Helper.trim(first, ".");
last = Helper.trim(last, ".");
text = text.replace("$name$", fullName == null ? "" : Html.escapeHtml(fullName));
text = text.replace("$firstname$", first == null ? "" : Html.escapeHtml(first));
text = text.replace("$lastname$", last == null ? "" : Html.escapeHtml(last));

@ -2151,6 +2151,21 @@ public class Helper {
return (c == '.' /* Latin */ || c == '。' /* Chinese */);
}
static String trim(String value, String chars) {
if (value == null)
return null;
for (Character kar : chars.toCharArray()) {
String k = kar.toString();
while (value.startsWith(k))
value = value.substring(1);
while (value.endsWith(k))
value = value.substring(0, value.length() - 1);
}
return value;
}
// Files
static {

Loading…
Cancel
Save