68 lines
1.9 KiB
Java
68 lines
1.9 KiB
Java
package com.ubtech.utils;
|
|
|
|
import java.net.URLDecoder;
|
|
import java.net.URLEncoder;
|
|
import java.util.regex.Pattern;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class StringUtils {
|
|
public static boolean a(CharSequence charSequence) {
|
|
return a("^((13[0-9])|(14[5,9])|16[0-7]|(15[0-3,5-9])|(17[0-3,5-8])|(18[0-9])|(147)|(149)|(191)|(193)|(19[8,9]))\\d{8}$", charSequence);
|
|
}
|
|
|
|
public static String b(String str) {
|
|
try {
|
|
return URLEncoder.encode(str, "UTF-8");
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
return str;
|
|
}
|
|
}
|
|
|
|
public static String c(String str) {
|
|
return String.format("TB_DIY_STEP_%s", str);
|
|
}
|
|
|
|
public static boolean d(String str) {
|
|
try {
|
|
return Pattern.compile("[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}").matcher(str).matches();
|
|
} catch (Exception unused) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static boolean e(String str) {
|
|
return str == null || str.length() < 1;
|
|
}
|
|
|
|
public static boolean f(String str) {
|
|
try {
|
|
return Pattern.compile("[0-9]{1,}").matcher(str).matches();
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static boolean a(String str, CharSequence charSequence) {
|
|
return charSequence != null && charSequence.length() > 0 && Pattern.matches(str, charSequence);
|
|
}
|
|
|
|
public static String a(String str) {
|
|
try {
|
|
return URLDecoder.decode(str, "UTF-8");
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
return str;
|
|
}
|
|
}
|
|
|
|
public static boolean a(char c) {
|
|
return Pattern.compile("[\\u4e00-\\u9fa5]").matcher(c + "").matches();
|
|
}
|
|
|
|
public static String a(String str, String str2) {
|
|
return String.format("TB_DIY_STEP_%s_%s", str, str2);
|
|
}
|
|
}
|