java - from file to arraylist, from arraylist to array[] -


i have text file contains this:

1 1 0 0 1 2 0 0 1 0 1 0 1 0 2 0 1 0 0 1 1 0 0 2 2 1 0 0 2 2 0 0 2 0 1 0 2 0 2 0 2 0 0 1 2 0 0 2 

then, put contents in arraylist. result same in file. next, want process data 1 1 , put each row of content in array[][] the data seperated row. result this:

output[0][]={1 1 0 0} output[1][]={1 2 0 0} output[2][]={1 0 1 0} output[3][]={1 0 2 0} .... .... .... 

question, how can take string in arraylist become separated data? code in java

thanks

you can use " public string[] split(string regexp)" method split string in array specifying character split in argument. e.g.string temp = "1 2 3 4"; temp.split(" "); split blank space in case..


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -