2010年1月7日

JAVA日期验证 正则表达式,包括润二月(转)

摘要: import java.util.regex.Pattern; public class ZhengZe {/** * @param args */public static void main(String[] args) {Pattern p = Pattern.compile("^((\\d{2}(([02468][048])|([13579][26]))[\\/\\/\\s]?((((0?... 阅读全文

posted @ 2010-01-07 19:10 蜗牛与老鹰 阅读(597) 评论(0) 推荐(0)

JAVA中去掉空格 trim函数 其他代码

摘要: JAVA中去掉空格 1. String.trim()trim()是去掉首尾空格2.str.replace(" ", ""); 去掉所有空格,包括首尾、中间String str = " hell o ";String str2 = str.replaceAll(" ", "");System.out.println(str2);3.或者replaceAll(" +",""); 去掉所有空格4.str... 阅读全文

posted @ 2010-01-07 17:26 蜗牛与老鹰 阅读(12062) 评论(0) 推荐(0)

java 全角半角转换函数

摘要: java 全角半角转换函数 测试过了比较好用,下面是我写的测试函数public static void main(String[] args) { String QJstr = "wch"; String QJstr1 = "hello"; String result = ToSBC(QJstr); String result1 = ToDBC(QJstr1); System.out.printl... 阅读全文

posted @ 2010-01-07 17:02 蜗牛与老鹰 阅读(1427) 评论(0) 推荐(0)

导航