当前位置: 首页 > news >正文

西安模板建站定制淘宝代运营1个月多少钱

西安模板建站定制,淘宝代运营1个月多少钱,网站制作需要的软件,网站建设业务拓展String.format其实是调用的Formatter.format#xff1a; public static String format(String format, Object... args) {return new Formatter().format(format, args).toString();} 第一个参数是格式化字符串#xff0c;第二个参数是可变的被格式化的参数。 我们主要看的是…String.format其实是调用的Formatter.format public static String format(String format, Object... args) {return new Formatter().format(format, args).toString();} 第一个参数是格式化字符串第二个参数是可变的被格式化的参数。 我们主要看的是格式化参数的说明 The format specifiers for general, character, and numeric types have the following syntax: %[argument_index$][flags][width][.precision]conversion 这个参数是用来格式化通用的、字符串、数字类型主要说一下每个参数的作用 % 用于表示这后面将是一个格式化数据的模板 argument_index$ 表示要作用在第几个参数上注意一定要加上$ flags 以下是flag的对照表对不同的类型有不同的作用 The following table summarizes the supported flags. y means the flag is supported for the indicated argument types. FlagGeneralCharacterIntegralFloating PointDate/TimeDescription-yyyyyThe result will be left-justified.#y1-y3y-The result should use a conversion-dependent alternate form--y4y-The result will always include a sign  --y4y-The result will include a leading space for positive values0--yy-The result will be zero-padded,--y2y5-The result will include locale-specific grouping separators(--y4y5-The result will enclose negative numbers in parentheses 1 Depends on the definition of Formattable. 2 For d conversion only. 3 For o, x, and X conversions only. 4 For d, o, x, and X conversions applied to BigInteger or d applied to byte, Byte, short, Short, int and Integer, long, and Long. 5 For e, E, f, g, andG conversions only. Any characters not explicitly defined as flags are illegal and are reserved for future extensions.  Width The width is the minimum number of characters to be written to the output. For the line separator conversion, width is not applicable; if it is provided, an exception will be thrown. Precision For general argument types, the precision is the maximum number of characters to be written to the output. For the floating-point conversions a, A, e,E, and f the precision is the number of digits after the radix point. If the conversion isg or G, then the precision is the total number of digits in the resulting magnitude after rounding. For character, integral, and date/time argument types and the percent and line separator conversions, the precision is not applicable; if a precision is provided, an exception will be thrown. Argument Index The argument index is a decimal integer indicating the position of the argument in the argument list. The first argument is referenced by 1$, the second by 2$, etc. Another way to reference arguments by position is to use the (\u003c) flag, which causes the argument for the previous format specifier to be re-used. For example, the following two statements would produce identical strings: Calendar c ...;String s1 String.format(Dukes Birthday: %1$tm %1$te,%1$tY, c);String s2 String.format(Dukes Birthday: %1$tm %te,%tY, c); 最重要的是conversion ConversionArgument CategoryDescriptionb, BgeneralIf the argument arg is null, then the result is false. Ifarg is a boolean or Boolean, then the result is the string returned by String.valueOf(arg). Otherwise, the result is true.h, HgeneralIf the argument arg is null, then the result is null. Otherwise, the result is obtained by invokingInteger.toHexString(arg.hashCode()).s, SgeneralIf the argument arg is null, then the result is null. Ifarg implements Formattable, then arg.formatTo is invoked. Otherwise, the result is obtained by invokingarg.toString().c, CcharacterThe result is a Unicode characterdintegralThe result is formatted as a decimal integerointegralThe result is formatted as an octal integerx, XintegralThe result is formatted as a hexadecimal integere, Efloating pointThe result is formatted as a decimal number in computerized scientific notationffloating pointThe result is formatted as a decimal numberg, Gfloating pointThe result is formatted using computerized scientific notation or decimal format, depending on the precision and the value after rounding.a, Afloating pointThe result is formatted as a hexadecimal floating-point number with a significand and an exponent. This conversion isnot supported for the BigDecimal type despite the latters being in thefloating point argument category.t, Tdate/timePrefix for date and time conversion characters. See Date/Time Conversions.%percentThe result is a literal % (\u0025)nline separatorThe result is the platform-specific line separator  示例代码 package main;public class StringFormat {public static void main(String[] args) {// TODO Auto-generated method stubString format Haha.%1$(g%2$s%3$s;Object obj 100f, object1 fdsafds, object2 new StringFormat();String format2 String.format(format, obj, object1, object2);System.out.println(format2);// String Format總結// %[argument_index$][flags][width][.precision]conversion 标准表达式}}运行结果 Haha.100.000fdsafdsmain.StringFormat6d6f6e28
http://www.tj-hxxt.cn/news/139624.html

相关文章:

  • 北京创意网站建设如何建设自己网站
  • 网站开发者不给源代码怎么办图片制作工具
  • ps企业网站模板做网站 工资高吗
  • 关于asp sql网站开发的书籍东莞seo
  • 垂直电商网站建设绵阳网站建设优化
  • 网站开发软件系统科技类网站
  • 江苏省网站建设与管理历年自考试题车网站模板预览
  • 加强网站政务服务建设方案汽油价格最新调整最新消息
  • 周口网站制作公司哪家好广西住房和城乡建设厅
  • 织梦网站建设选项卡教程好的公众号
  • 网站公告建设方案wordpress分类目录网址优化
  • 红旗渠建设集团网站wordpress转帝国cms
  • 一个完整网站制作的实例网站中图片加水印
  • 陕西四通建设工程有限责任公司网站东营 网站建设公司
  • 网站制作需要哪些东西企业网站开发设计
  • j2ee网站开发开题报告wordpress 内网 插件
  • python做网站 不适合淘宝网站建设素材
  • wordpress的地址在本地seo权重优化
  • 化妆品网站程序wordpress是什么系统
  • 网站vps被黑医院门户网站模板下载
  • 广州做大型网站建设ftp网站地图怎么做
  • 行业前10的网站建设公当铺网站建设方案
  • 手机版网站建设多少钱常州市工程建设交易网
  • 刘强东当年做网站读的什么书北京到石家庄
  • 用html网站登录界面怎么做公司网站找谁做
  • 个人网站网页设计模板网站建设要多久豆瓣
  • 网站模板下载百度云链接怎么做wordpress写的网站
  • 合肥公司门户网站制作多语言企业网站源码
  • 青岛公司注册网站网站服务器在那里找
  • 石狮网站建设费用个人建站需要多少钱