久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='hPXcr'><style id='hPXcr'><dir id='hPXcr'><q id='hPXcr'></q></dir></style></legend>
  • <small id='hPXcr'></small><noframes id='hPXcr'>

        <bdo id='hPXcr'></bdo><ul id='hPXcr'></ul>

      1. <i id='hPXcr'><tr id='hPXcr'><dt id='hPXcr'><q id='hPXcr'><span id='hPXcr'><b id='hPXcr'><form id='hPXcr'><ins id='hPXcr'></ins><ul id='hPXcr'></ul><sub id='hPXcr'></sub></form><legend id='hPXcr'></legend><bdo id='hPXcr'><pre id='hPXcr'><center id='hPXcr'></center></pre></bdo></b><th id='hPXcr'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hPXcr'><tfoot id='hPXcr'></tfoot><dl id='hPXcr'><fieldset id='hPXcr'></fieldset></dl></div>
      2. <tfoot id='hPXcr'></tfoot>

      3. 使用 String.format() 打印空格

        print spaces with String.format()(使用 String.format() 打印空格)

            <i id='7Gvfn'><tr id='7Gvfn'><dt id='7Gvfn'><q id='7Gvfn'><span id='7Gvfn'><b id='7Gvfn'><form id='7Gvfn'><ins id='7Gvfn'></ins><ul id='7Gvfn'></ul><sub id='7Gvfn'></sub></form><legend id='7Gvfn'></legend><bdo id='7Gvfn'><pre id='7Gvfn'><center id='7Gvfn'></center></pre></bdo></b><th id='7Gvfn'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7Gvfn'><tfoot id='7Gvfn'></tfoot><dl id='7Gvfn'><fieldset id='7Gvfn'></fieldset></dl></div>
              <tbody id='7Gvfn'></tbody>

                <bdo id='7Gvfn'></bdo><ul id='7Gvfn'></ul>
                <tfoot id='7Gvfn'></tfoot>
                  <legend id='7Gvfn'><style id='7Gvfn'><dir id='7Gvfn'><q id='7Gvfn'></q></dir></style></legend>

                  <small id='7Gvfn'></small><noframes id='7Gvfn'>

                1. 本文介紹了使用 String.format() 打印空格的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我該如何重寫:

                  for (int i = 0; i < numberOfSpaces; i++) {
                      System.out.print(" ");
                  }
                  

                  使用 String.format()?

                  PS

                  我很確定這是可能的,但是 javadoc 有點混亂.

                  I'm pretty sure that this is possible but the javadoc is a bit confusing.

                  推薦答案

                  需要指定字段的最小寬度.

                  You need to specify the minimum width of the field.

                  String.format("%" + numberOfSpaces + "s", ""); 
                  

                  為什么要生成一定長度的空格字符串.

                  Why do you want to generate a String of spaces of a certain length.

                  如果你想要一列這樣長度的值,那么你可以這樣做:

                  If you want a column of this length with values then you can do:

                  String.format("%" + numberOfSpaces + "s", "Hello"); 
                  

                  這會給你 numberOfSpaces-5 個空格,然后是 Hello.如果您希望 Hello 出現在左側,請在 numberOfSpaces 之前添加一個減號.

                  which gives you numberOfSpaces-5 spaces followed by Hello. If you want Hello to appear on the left then add a minus sign in before numberOfSpaces.

                  這篇關于使用 String.format() 打印空格的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數轉換為整數?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)
                      <tbody id='xZ2kt'></tbody>

                      • <bdo id='xZ2kt'></bdo><ul id='xZ2kt'></ul>

                      • <legend id='xZ2kt'><style id='xZ2kt'><dir id='xZ2kt'><q id='xZ2kt'></q></dir></style></legend>

                          <tfoot id='xZ2kt'></tfoot>

                          <small id='xZ2kt'></small><noframes id='xZ2kt'>

                          <i id='xZ2kt'><tr id='xZ2kt'><dt id='xZ2kt'><q id='xZ2kt'><span id='xZ2kt'><b id='xZ2kt'><form id='xZ2kt'><ins id='xZ2kt'></ins><ul id='xZ2kt'></ul><sub id='xZ2kt'></sub></form><legend id='xZ2kt'></legend><bdo id='xZ2kt'><pre id='xZ2kt'><center id='xZ2kt'></center></pre></bdo></b><th id='xZ2kt'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xZ2kt'><tfoot id='xZ2kt'></tfoot><dl id='xZ2kt'><fieldset id='xZ2kt'></fieldset></dl></div>
                            主站蜘蛛池模板: 久久国产精品久久久久 | 日本中文字幕一区 | 欧美日韩国产一区二区三区不卡 | 91麻豆久久久 | 久久久久久久久久久久久9999 | 日韩免费在线视频 | 欧美激情久久久 | 成人免费视频久久 | 国产乱码精品一区二区三区五月婷 | 美女视频一区二区三区 | 国产一区二区精 | 欧美中文字幕一区 | 91一区二区 | 成人免费视频在线观看 | 日本精品久久久一区二区三区 | 国产精品爱久久久久久久 | 日韩中文字幕网 | 春色av| 正在播放一区二区 | 在线视频国产一区 | 国产日韩欧美精品一区二区 | 青青草中文字幕 | 亚洲一区成人 | 国产欧美在线视频 | 久久aⅴ乱码一区二区三区 亚洲欧美综合精品另类天天更新 | 日韩国产高清在线观看 | 成人国产精品久久久 | 五月综合激情网 | 欧美日韩在线不卡 | 黄网站在线观看 | 欧美小视频在线观看 | 欧美99 | 亚洲一区二区三区免费在线观看 | 在线观看视频h | 在线一级片 | 国产第一区二区 | 九九免费| 玖玖玖av| 91中文字幕在线 | 国产成人在线观看免费 | 午夜三级在线观看 |