• <tfoot id='P3WOT'></tfoot>

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

      1. java中字符串中的数字

        时间:2023-10-14
      2. <legend id='NnU3H'><style id='NnU3H'><dir id='NnU3H'><q id='NnU3H'></q></dir></style></legend>

              <tbody id='NnU3H'></tbody>

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

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

                  本文介绍了java中字符串中的数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有类似ali123hgj"的东西.我想要整数 123.我怎样才能在java中制作它?

                  I have something like "ali123hgj". i want to have 123 in integer. how can i make it in java?

                  推荐答案

                  使用以下 RegExp(参见 http://java.sun.com/docs/books/tutorial/essential/regex/):

                  Use the following RegExp (see http://java.sun.com/docs/books/tutorial/essential/regex/):

                  d+
                  

                  作者:

                  final Pattern pattern = Pattern.compile("\d+"); // the regex
                  final Matcher matcher = pattern.matcher("ali123hgj"); // your string
                  
                  final ArrayList<Integer> ints = new ArrayList<Integer>(); // results
                  
                  while (matcher.find()) { // for each match
                      ints.add(Integer.parseInt(matcher.group())); // convert to int
                  }
                  

                  这篇关于java中字符串中的数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何从字符串中取出数字? 下一篇:从字符串中解析多个双精度数

                  相关文章

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

                  <tfoot id='UC3HQ'></tfoot>
                • <legend id='UC3HQ'><style id='UC3HQ'><dir id='UC3HQ'><q id='UC3HQ'></q></dir></style></legend>
                  • <bdo id='UC3HQ'></bdo><ul id='UC3HQ'></ul>

                    1. <small id='UC3HQ'></small><noframes id='UC3HQ'>