java - How to do a split string and store into a variable for future use? -
i have android app receives data excel file. im using libray text excel textview.i have 3 columns in excel receiving. reason want divide string receive 3 positions in order save in sqlite information excel gives , put them in respective rows of sqlite database.i want know how proper string split , store information. this output of app receives excel in advanced.
try { assetmanager am=getassets(); inputstream is=am.open("book1.xls"); workbook wb =workbook.getworkbook(is); sheet s=wb.getsheet(0); int row =s.getrows(); int col=s.getcolumns(); string xx=""; for(int i=0;i<row;i++) { (int c=0;c<col;c++) { cell z=s.getcell(c,i); xx=xx+z.getcontents()+"\n"; //here want divide string in 3 positions } xx=xx+"\n"; } textview.settext(xx); } catch (exception e) { }
do want this?
string[] result = mystring.split(" "); string = result[0]; string b = result[1]; string c = result[2];
Comments
Post a Comment