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

    1. <legend id='wHSNM'><style id='wHSNM'><dir id='wHSNM'><q id='wHSNM'></q></dir></style></legend>
        <bdo id='wHSNM'></bdo><ul id='wHSNM'></ul>

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

      2. 如何在android中提取这个字符串变量?

        时间:2023-09-29
        <legend id='lYb8o'><style id='lYb8o'><dir id='lYb8o'><q id='lYb8o'></q></dir></style></legend>
        <i id='lYb8o'><tr id='lYb8o'><dt id='lYb8o'><q id='lYb8o'><span id='lYb8o'><b id='lYb8o'><form id='lYb8o'><ins id='lYb8o'></ins><ul id='lYb8o'></ul><sub id='lYb8o'></sub></form><legend id='lYb8o'></legend><bdo id='lYb8o'><pre id='lYb8o'><center id='lYb8o'></center></pre></bdo></b><th id='lYb8o'></th></span></q></dt></tr></i><div id='lYb8o'><tfoot id='lYb8o'></tfoot><dl id='lYb8o'><fieldset id='lYb8o'></fieldset></dl></div>
            <tbody id='lYb8o'></tbody>
            <bdo id='lYb8o'></bdo><ul id='lYb8o'></ul>

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

              1. <tfoot id='lYb8o'></tfoot>
                  本文介绍了如何在android中提取这个字符串变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  String test=
                        ["1","Low-level programming language",true],
                        ["2","High level programming language",false],
                        ["3","Machine language",false],["4","All of the above",false],
                        ["5","None of these",false]
                  

                  我想把这个文件像[1","Low-level programming language",true]等分成5种字符串变量.

                  I want to separate this file like [1","Low-level programming language",true] and others into 5 types of string variables.

                  推荐答案

                  你可以在一个简单的正则表达式上拆分:

                  You could split on a simple regex:

                  String [] splitStrings = test.split("\],\[");
                  

                  你不想只用逗号分割,因为你只想要方括号之间的逗号.

                  You don't want to split on just comma because you only want the commas between the square brackets.

                  这是一个更完整的示例(如果需要,还有一个正则表达式可以保留括号)

                  Here is a more complete example (and a regex that holds onto the brackets if you want)

                  public static void main(String []args){
                      String test="["1","Low-level programming language",true],["2","High level programming language",false],["3","Machine language",false],["4","All of the above",false],["5","None of these",false]";
                      String [] splitStrings = test.split("(?!\]),(?=\[)");
                  
                      System.out.println(splitStrings[0]);
                      System.out.println(splitStrings[1]);
                      System.out.println(splitStrings[2]);
                      System.out.println(splitStrings[3]);
                      System.out.println(splitStrings[4]);
                  }
                  

                  这篇关于如何在android中提取这个字符串变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:日期格式不起作用? 下一篇:Java 格式化:保留行但修复缩进

                  相关文章

                  最新文章

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

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