close

String strsplit = "DUCK,Eric,BEN,JOHN";

if(strsplit .indexOf(",")!=-1){

    String [] array = strsplit.split(",");

    for(int i = 0; i < array.length; i++){

         System.out.println(i+array);

    }

}

println

0DUCK

1Eric

2BEN

3JOHN

 

BUT SPECIAL .  |   ^

String strsplit = "DUCK|Eric|BEN|JOHN";

String [] array = strsplit.split("\\|");

arrow
arrow
    文章標籤
    android split
    全站熱搜

    鴨鴨仔 發表在 痞客邦 留言(0) 人氣()