public class FmtUtil extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
blur(String str,
int pos,
int num)
字符串模糊化
|
static String |
blur(String str,
String diff)
对字符串进行模糊化处理:PN-电话号码,ID-身份证,EM-邮件,BA-银行账户
默认对全局所有人都模糊化,仅放开对个别人不模糊化 |
static String |
commaFmt(double num,
int digit)
数字以千分位展示,保留N位小数点
|
static String |
commaFmt(double num,
int digit,
String def)
数字以千分位展示,保留N位小数点
|
static String |
commaFmt(String str,
int digit)
数字以千分位展示,保留N位小数点
|
static String |
commaFmt(String str,
int digit,
String def)
数字以千分位展示,保留N位小数点
|
static boolean |
findIn(String str,
String regex)
字符串中是否包含指定的字符串,如:"\\d+"
|
static String |
ifZero(String str,
String def)
把符号“0”、“0.0+”转为空字符串
|
static String |
indent(String str,
int num,
char chr)
缩进值为指定位数的左边距
|
static boolean |
isInteger(String str)
字符串中是否有完全匹配:匹配字符或数字
|
static boolean |
isMatch(String str,
String regex)
字符串中是否有完全匹配:匹配字符或数字
|
static boolean |
isNumeric(String str)
判断是否为浮点数:包含整数、小数、负数
|
static boolean |
isValidWord(String val)
匹配一个或多个由汉字、空格、数字或下划线组成的字符串
|
static boolean |
isZero(Object obj)
判断字符串是否为“0”、“0.0+”
|
static String |
leftPad(String str,
int width)
字符串左侧填充符号到指定宽度
|
static String |
leftPad(String str,
int size,
char chr)
字符串左侧填充符号到指定长度
|
static String |
nextSeq(String seqNo)
把整数的62进制的序列号自动加1
|
static String |
parse(double num,
int digit)
把金额、数量、单价等数值转换成字指定格式的符串
|
static String |
parse(String str,
int digit)
把金额、数量、单价等数值转换成字指定格式的符串
|
static String |
pHolder(Object key,
String opr)
占位符处理:placeHolder
|
static String |
quote(Object str,
String ch)
字符对称引用号“str”
|
static String |
timeParse(Calendar cal,
String pattern)
根据日期格式,获取当前日期时间:pattern格式
|
static String |
timeParse(String str,
String pat0,
String pat1)
时间(日期)格式转变
|
static String |
toBase62(long num,
int width)
字符串左侧填充符号到指定宽度
|
static String |
toRmb(long num)
人民币汉字大写,传入数值可大于1万亿元
|
static String |
toRmb(String money)
人民币汉字大写,传入数值可大于1万亿元
|
static String |
toYuan(String str,
String def)
分变成带千分位格式的金额(元),四舍五入
|
public static boolean isValidWord(String val)
public static String blur(String str, String diff)
public static String blur(String str, int pos, int num)
str - 字符串pos - 居右侧的位置,补充*的位数num - 补充*的位数public static String toBase62(long num, int width)
public static String commaFmt(double num, int digit)
num - 精度数据digit - 小数点精度的位数public static String commaFmt(double num, int digit, String def)
num - 精度数据digit - 小数点精度的位数def - 默认0的返回字符串public static String parse(double num, int digit)
public static boolean isZero(Object obj)
public static String toRmb(long num)
public static boolean isInteger(String str)
public static boolean isNumeric(String str)
public static boolean isMatch(String str, String regex)
Copyright © 2024. All rights reserved.