zoukankan      html  css  js  c++  java
  • Java 常用工具类

    MessageFormat

    FormatElement:
             { ArgumentIndex }
             { ArgumentIndex , FormatType }
             { ArgumentIndex , FormatType , FormatStyle }

     

     FormatType
             number

             date

             time

             choice(需要使用ChoiceFormat)

     

     FormatStyle:
             short
             medium
             long
             full
             integer
             currency
             percent
             SubformatPattern(子模式)

    String str = "I'm not a {0}, age is {1,number,short}", height is {2,number,#.#};

    String message = "oh, '{0}' is a pig";  

    Object[] array = new Object[]{"ZhangSan"};  

    String value = MessageFormat.format(message, array);  

    System.out.println(value); 

  • 相关阅读:
    file
    shell脚本的执行
    添加源,删除源
    lsattr, chattr
    umask
    od
    init
    sync
    wc
    history
  • 原文地址:https://www.cnblogs.com/leonkobe/p/5687818.html
Copyright © 2011-2022 走看看