![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
csdn_HERUNZE
学渣
展开
-
正则表达式判断字符串中是否有汉字
String ChineseCharactersStr = “这里是汉字也有yingwen”;需要导入 import java.util.regex.Matcher; import java.util.regex.Pattern;Pattern p = Pattern.compile(“[\u4e00-\u9fa5]”); Matcher m = p.matcher(ChineseCharac原创 2017-08-09 15:32:50 · 5806 阅读 · 0 评论 -
将小数转为折扣形式
String discount = “小数的折扣”;BigDecimal b2 = new BigDecimal(discount); BigDecimal b1 = new BigDecimal(100); if (b2 != null) { BigDecimal b3 = b1.multiply(b2); if (b3 !=原创 2017-08-10 18:17:51 · 2426 阅读 · 0 评论