Fix non-standard numeral entry.

This commit is contained in:
Alex Hart
2021-12-01 15:53:55 -04:00
committed by GitHub
parent b981ac4fe4
commit f9a2208832
5 changed files with 68 additions and 5 deletions

View File

@@ -233,6 +233,10 @@ public final class StringUtil {
return text.replaceAll("[\\u2068\\u2069\\u202c]", "");
}
public static @NonNull String stripBidiIndicator(@NonNull String text) {
return text.replace("\u200F", "");
}
/**
* Trims a {@link CharSequence} of starting and trailing whitespace. Behavior matches
* {@link String#trim()} to preserve expectations around results.