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

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

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 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>
                          <tbody id='UC3HQ'></tbody>

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