All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.afu.utils.string.HtmlStringUtils Maven / Gradle / Ivy

There is a newer version: 0.0.55-RELEASE
Show newest version
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; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy