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.

29 lines
724 B

/*
* ====================================================
* package : utils
* author : Created by nansi.
* time : 2019/5/14 10:45 AM
* remark :
* ====================================================
*/
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);
}
}