2016-10-25 2 views
0

while 루프에서 while 루프로 어떻게 변경합니까?정규식에서 while 루프에서 while 루프로 변경

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

for (String str : strArray) { 
    System.out.println("TestSplit: " + str); 
} 

저는 Java를 처음 사용했습니다.

+1

google while while 루프를 사용하여 반복 처리하는 방법. 몇 가지 연구 노력을 기울여 여기에 질문을 게시하십시오. – silentprogrammer

+0

모든 for-loops는 기본적으로 glorified while while 루프이고 for for each 루프는 for-loop입니다. 먼저 for-loop로 변환하면 분명합니다. – Gendarme

답변

1
int index = 0; 

while(index < strArray.length) 
{ 
    system.out.println(strArray[index]); 
    index++; 
}