随笔分类 -  java

摘要:public static int countChar(String str,char ch) { // 将字符串转换为字符数组 char[] chs = str.toCharArray(); // 定义变量count存储字符串出现的次数 int count = 0; for(int i = 0;i 阅读全文
posted @ 2020-07-22 14:47 遗忘无际 阅读(2226) 评论(0) 推荐(0)
摘要:public static void main(String[] args) { String filePath="/2652E01E/20200715/20200715111432119AZg6ByUMTdeDAvGk3HfXRCZS4B4=.pdf"; String file=filePath. 阅读全文
posted @ 2020-07-13 15:01 遗忘无际 阅读(874) 评论(0) 推荐(0)
摘要:public static void main(String[] args) throws Exception { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); Date fprqDate = sdf.parse("20200101 阅读全文
posted @ 2020-06-28 10:54 遗忘无际 阅读(757) 评论(0) 推荐(0)
摘要:public static void main(String[] args) { String aString="w14-rq22.3"; //只保留数字 aString = aString.replaceAll("[^(0-9)]",""); System.out.println(aString) 阅读全文
posted @ 2020-06-21 14:02 遗忘无际 阅读(119) 评论(0) 推荐(0)
摘要:public static void main(String[] args) { double a = 0; double b = 11.0; System.out.println(String.format("%.2f", a)); System.out.println(String.format 阅读全文
posted @ 2020-06-21 13:43 遗忘无际 阅读(140) 评论(0) 推荐(0)
摘要:public static void main(String[] args) { HashSet<Integer> has = new HashSet<Integer>(); has.add(1); has.add(0); has.add(5); has.add(12); has.add(1); h 阅读全文
posted @ 2020-06-18 15:52 遗忘无际 阅读(334) 评论(0) 推荐(0)