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); 

  • 相关阅读:
    查看占用内存cpu top10
    free 详解
    find
    服务器硬件查看
    firewalld命令使用
    firewalld-zone概念介绍
    Jenkins rpm包安装
    攻击防御案例
    filebeat收集系统登陆日志
    nginx转换json格式
  • 原文地址:https://www.cnblogs.com/leonkobe/p/5687818.html
Copyright © 2011-2022 走看看