delimiter - How to delimitate the given string to get output in an array in java? -


how delimit given string output of given string in array in java ?

 str= "[[["eee","wwww","fff","0","1","3"]]]" 

output:

 array[0]=eee   array[1]=wwww   array[2]=fff   array[3]=0   array[4]=1   array[5]=3 

i getting above input after json parsing in android studio. values "eee","wwww" stored in mysql database , want retrieve values replacing other.

try use this:

    string[] arr =str.split("\\b(.*?)\\b");     (int = 1; i<arr.length-1;i++) {         if(arr[i].endswith(","))            system.out.print(arr[i].subsequence(0, arr[i].length()-1)+ " ");         else             system.out.print(arr[i]+ " ");       } 

output:

  eee  wwww  fff  0  1  3  

Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -