Java 将for循环更改为regex的while循环

Java 将for循环更改为regex的while循环,java,for-loop,while-loop,Java,For Loop,While Loop,如何将for循环更改为while循环 String [] strArray = testcontent.split(Pattern.quote("SolrDocument{content=[")); for (String str : strArray) { System.out.println("TestSplit: " + str); } 我是Java新手 int索引=0; int index = 0; while(index < strArray.length) { s

如何将for循环更改为while循环

String [] strArray = testcontent.split(Pattern.quote("SolrDocument{content=["));

for (String str : strArray) {
  System.out.println("TestSplit: " + str);
}
我是Java新手

int索引=0;
int index = 0;

while(index < strArray.length)
{
  system.out.println(strArray[index]);
  index++;
}
while(索引
google
如何在java中使用while循环迭代数组
。做一些研究,然后把问题贴在这里。所有的for循环基本上都是美化的,而每个循环都是美化的for循环。首先将其转换为正常的for循环,然后它应该是明显的。