admin
2022-03-31 36754ba47da7a3277d5be183a523c912a1dc4cef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class StringUtil {
  //是否为电话号码
  static bool isMobile(String str) {
    return RegExp(
            '^((13[0-9])|(15[^4])|(166)|(17[0-8])|(18[0-9])|(19[8-9])|(147,145))\\d{8}\$')
        .hasMatch(str);
  }
 
  static bool isEmail(String str) {
    return RegExp(
        '^(\\w)+(\\.\\w+)*@(\\w)+((\\.\\w+)+)\$')
        .hasMatch(str);
  }
 
  static bool isNullOrEmpty(String? str) {
    return str==null|| str.isEmpty || str.trim().isEmpty;
  }
 
}