冰山一角:
String.format("%1$03d", 1)
public void testTwo(){
Properties pros = System.getProperties();
/*Enumeration enumeration = pros.propertyNames();
while(enumeration.hasMoreElements()){
System.out.println(enumeration.nextElement());
}*/
Set<String> sets = pros.stringPropertyNames();
Iterator<String> it = sets.iterator();
int num = 1;
while(it.hasNext()){
System.out.println(String.format("%1$03d", num) + " : " + it.next());
num++;
}
}
分享到:
相关推荐
解决mongo数据插入时 报错问题 mogodb插入数据时报错Can't find a codec for class java.math.BigDecimal
* @return java.lang.String * @author xm * @create 2018/6/7 12:03 **/ public static String format2point(Number value) { return df.format(value); } public static Double add(Number value1, ...
$s = new Java( "java.lang.String" , "php-java-bridge config...<br> " ); echo $s ; // demonstrate property access print 'Java version=' . $system ->getProperty( 'java.version' ). ' ' ; print...
build the md5 by concat the strings together, then you can use the java.lang.String.format method. But in Camel 2.0 we have added two convenient methods in the Java DSL so you can do fromF and toF ...
format.setToneType(HanyuPinyinToneType.WITHOUT_TONE); format.setVCharType(HanyuPinyinVCharType.WITH_V); char[] input = inputString.trim().toCharArray(); String output = ""; try { for ...
2、支持类静态的方法调用和值访问,表达式的格式为@[类全名(包括包路径)]@[方法名 | 值名],例如:@java.lang.String@format('foo %s', 'bar')或@tutorial.MyConstant@APP_NAME; 3、支持赋值操作和表达式串联...
支持类静态的方法调用和值访问,表达式的格式为@[类全名(包括包路径)]@[方法名 | 值名],例如:@java.lang.String@format('foo %s', 'bar')或@tutorial.MyConstant@APP_NAME; 3. 支持赋值操作和表达式串联,如...
支持类静态方法调用和值的访问,表达式的格式为@[类全名]@[方法名|值名],例如:@java.lang.String@format(‘foo %s’,’bar’) ? 操作集合对象。 Ognl有一个上下文(Context)的概念,其实就是一个Map结构,...
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; import ...
import java.lang.reflect.InvocationTargetException; /** * A demo PDF Viewer application. */ public class PDFViewer extends JFrame implements KeyListener, TreeSelectionListener, PageChangeListener...
Date bir=format.parse(birthday); System.out.println(bir); } catch (ParseException e) { ① // TODO Auto-generated catch block e.printStackTrace(); } } } 代码解析: ① 用SimpleDateFormat解析日期...
2、支持类静态的方法调用和值访问,表达式的格式为@[类全名(包括包路)]@[方法名 | 值名],例如: @java.lang.String@format('foo %s', 'bar')或@tutorial.MyConstant@APP_NAME; 3、支持赋值操作和表达式串联,...
/** * @(#)DateUtil.java * ... public static Date strToDate(String dateStr, String format) { Date date = null; if (dateStr != null && (!dateStr.equals(""))) { DateFormat df ...
import java.lang.reflect.Field; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql....
return format.format(getSystemDate()); } /** * Nヶ月後の当月の最初の日を取得する * * @param n * Nヶ月後 * @return Nヶ月後の当月の最初の日 */ public static Calendar getMonthFirstDay(int n...
private final String windowsParseMacAddress(String ipConfigResponse) throws java.text.ParseException { String localHost = null; try { localHost = java.net.InetAddress.getLocalHost().getHostAddress(); ...
import java.lang.*; import javax.swing.*; import javax.swing.event.*; import java.awt.event.*; import java.awt.Component.*; import java.awt.color.*; import java.text.DecimalFormat; //*************...
Overrides the standard java.lang.Object.clone method to return a copy of this cookie. containsHeader(String) - Method in class javax.servlet.http.HttpServletResponseWrapper The default behavior of ...