io.afu.utils.string.HtmlStringUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utils Show documentation
Show all versions of utils Show documentation
RffanLAB Utils For Many Way use
package io.afu.utils.string;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class HtmlStringUtils {
/**
* 将整个html字符串中带p的段落,转换为数组列表。
* @param str 需要解析的字符串
* @return String[]
*/
public static String[] parsePtoList(String str){
String[] dealed = str.replace("","").replace(" ","").split("
");
return dealed;
}
/**
* 将数值转换单位
* @param num 需要转换的数值
* @return String
*/
public static String translateIntNumToStr(Integer num){
String word = "";
if (num>=10000 && num <100000000){
Integer tmp = num / 10000;
word = tmp.toString()+"万";
}else if (num >100000000){
Integer tmp = num / 100000000;
word = tmp.toString()+"亿";
}else {
word = num.toString();
}
return word;
}
public static Boolean isCNNumber(String toJudge){
String p = "^[玖捌柒陆伍肆叁贰壹零拾佰仟万亿圆]$";
Pattern pattern = Pattern.compile(p);
Matcher matcher = pattern.matcher(p);
if (matcher.find()){
return true;
}
return false;
}
}