You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aku_new_community/lib/utils/text_utils.dart

20 lines
498 B

class TextUtils {
///判断空字符串
///
///white 全空格是否算空字符串
static bool isEmpty(String str, {bool whiteSpace = false}) {
if (whiteSpace) {
return str == null || str.trim().length == 0;
}
return str == null || str.length == 0;
}
static bool isNotEmpty(String str, {bool whiteSpace = false}) {
return !isEmpty(str, whiteSpace: whiteSpace);
}
static bool verifyPhone(phone) {
return new RegExp("^^1\\d{10}\$").hasMatch(phone);
}
}