文章分类 - J2EE
摘要:1用JAVA自带的函数public static boolean isNumeric(String str){for (int i = str.length();--i>=0;){ if (!Character.isDigit(str.charAt(i))){return false;}}return true;}2用正则表达式public static boolean isNumeric(String str){ Pattern pattern = Pattern.compile("[0-9]*"); return pattern.matcher(str).matc
阅读全文
摘要:Java:String substring(int beginIndex, int endIndex)C# :string.Substring (int startIndex, int length)
阅读全文
摘要:(double) (Math.round(sd3*10000)/10000.0); // 这样为保持4位(double) (Math.round(sd3*100)/100.0); // 这样为保持2位.2.另一种办法import java.text.DecimalFormat;// 第一个为2位,第二个为3位.DecimalFormat df2 = new DecimalFormat("###.00");DecimalFormat df2 = new DecimalFormat("###.000");System.out.println(df2.form
阅读全文
摘要:参考网址:http://www.easywayserver.com/blog/java-how-to-read-xml-file/books.xml<?xml version="1.0" encoding="iso-8859-1"?><library> <book> <name>Head First Java, 2nd Edition</name> <author>Kathy Sierra and Bert Bates</author> <publication-d
阅读全文
浙公网安备 33010602011771号