• <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中字符串中的数字

        number out of string in java(java中字符串中的数字)
      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中字符串中的数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Compiling C++ for the JVM(为 JVM 编译 C++)
                  Compile to java bytecode (without using Java)(编译成java字节码(不使用Java))
                  How to drive C#, C++ or Java compiler to compute 1+2+3+...+1000 at compile time?(如何在编译时驱动 C#、C++ 或 Java 编译器计算 1+2+3+...+1000?)
                  Java ClassLoader: load same class twice(Java ClassLoader:两次加载相同的类)
                  How to debug .class files in ECLIPSE?(如何在 ECLIPSE 中调试 .class 文件?)
                  Java quot;The blank final field may not have been initializedquot; Anonymous Interface vs Lambda Expression(Java“可能尚未初始化空白的最终字段匿名接口与 Lambda 表达式)

                  • <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>
                          <tbody id='UC3HQ'></tbody>

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