+ public static String nullIsEmpty(Editable e) {
+ if (e == null)
+ return "";
+ return e.toString();
+ }
+ public static boolean equalStrings(String u, CharSequence text) {
+ return nullIsEmpty(u).equals(text.toString());
+ }
+ public static boolean equalStrings(String a, String b) {
+ return nullIsEmpty(a).equals(nullIsEmpty(b));
+ }
+ public static String trim(@Nullable String string) {
+ if (string == null)
+ return null;
+
+ return string.trim();