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

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

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

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

        在Android上將字符串轉(zhuǎn)換為整數(shù)

        Converting a string to an integer on Android(在Android上將字符串轉(zhuǎn)換為整數(shù))

          <tbody id='J9J3O'></tbody>

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

              <tfoot id='J9J3O'></tfoot>

                  <legend id='J9J3O'><style id='J9J3O'><dir id='J9J3O'><q id='J9J3O'></q></dir></style></legend>
                1. <small id='J9J3O'></small><noframes id='J9J3O'>

                2. 本文介紹了在Android上將字符串轉(zhuǎn)換為整數(shù)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  如何將字符串轉(zhuǎn)換為整數(shù)?

                  How do I convert a string into an integer?

                  我有一個文本框讓用戶輸入一個數(shù)字:

                  I have a textbox I have the user enter a number into:

                  EditText et = (EditText) findViewById(R.id.entry1);
                  String hello = et.getText().toString();
                  

                  并將值賦給字符串hello.

                  我想把它轉(zhuǎn)換成一個整數(shù),這樣我就可以得到他們輸入的數(shù)字;稍后將在代碼中使用.

                  I want to convert it to a integer so I can get the number they typed; it will be used later on in code.

                  有沒有辦法讓 EditText 變成一個整數(shù)?那將跳過中間人.如果沒有,字符串轉(zhuǎn)整數(shù)就可以了.

                  Is there a way to get the EditText to a integer? That would skip the middle man. If not, string to integer will be just fine.

                  推薦答案

                  查看 Integer 類和靜態(tài) parseInt() 方法:

                  See the Integer class and the static parseInt() method:

                  http://developer.android.com/reference/java/lang/整數(shù).html

                  Integer.parseInt(et.getText().toString());
                  

                  您需要捕獲 NumberFormatException 以防在解析時出現(xiàn)問題,因此:

                  You will need to catch NumberFormatException though in case of problems whilst parsing, so:

                  int myNum = 0;
                  
                  try {
                      myNum = Integer.parseInt(et.getText().toString());
                  } catch(NumberFormatException nfe) {
                     System.out.println("Could not parse " + nfe);
                  } 
                  

                  這篇關(guān)于在Android上將字符串轉(zhuǎn)換為整數(shù)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

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

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

                          • <small id='uEgud'></small><noframes id='uEgud'>

                              <tbody id='uEgud'></tbody>
                            <tfoot id='uEgud'></tfoot>
                            主站蜘蛛池模板: 天天干夜夜拍 | 成人在线视频播放 | 亚洲在线视频 | 午夜免费小视频 | 欧美成人一级片 | 在线播放黄色 | 亚洲第一色 | 狠狠五月天 | 久久精品欧美一区二区 | 亚洲一区在线看 | 麻豆av在线免费观看 | 成人一区二区视频 | 天天爽 | 久久不射网 | www.huangse | 免费一区二区视频 | 亚洲精品成人 | 日韩视频在线免费观看 | 国产精品成人一区 | 国产黄色三级 | 亚洲男人在线 | 国产一区二区免费看 | 91精品久久久久久久久 | 手机看片福利视频 | 欧美日韩在线看 | 日韩av网站在线观看 | 亚洲www. | 亚洲黄色在线观看 | 99re视频在线 | 国产精品视频免费在线观看 | 黄色片视频| 亚洲色综合 | www.一区| 在线观看免费黄色 | 超碰91在线| 日韩理论视频 | 四虎影视大全 | 国产精品成人国产乱一区 | 欧美激情亚洲 | 久久国产精| 人人爽人人爽人人爽 |