這是我讀該文件:存儲值()的標準
abc.txt
1,Arjun,12,GhandiNagar,Pune,411020
2,Deep,8,M.G.Road,Mumbai,411032
3,Deep,3,F.C.Road,Pune,411032
現在如何存放在一個字符串數組個別內容。 我用
String content="";
while(line=br.readLine()!=null)
{
content=line+content;
}
String x[]=content.split(",");
但根據這是分裂「」其結果是每一行的最後一個內容成爲411020'2‘/ 411032'3’。 那麼,如何在一個數組一樣
x[0]=1,x[1]=Arjun,x[2]=12,x[3]=GhandiNagar,x[4]=Pune,x[5]=411020,x[6]=2,etc..?
不要連接字符串。使用StringBuffer! –