package com.string.bcd;import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;public class ReadIC {public String citiaoka() throws IOException{
String ur1="D:/eclipse/workspace/StringBCD/src/com/string/bcd/ss.txt";
String strs="";
File file=new File(ur1);
try{
FileReader read = new FileReader(file);
StringBuffer sb=new StringBuffer();
char ch[]=new char[1024];
int d=read.read(ch);
while(d!=-1)
{
String str =new String(ch,0,d);
sb.append(str);
d=read.read(ch);
}
//System.out.println("sb:"+sb.toString());
String a=sb.toString();
System.out.println("cccc:"+a);
strs=a.substring(0,a.length());
}catch(FileNotFoundException e)
{
e.printStackTrace();

return strs;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
ReadIC cit=new ReadIC();
String cc;
String str1,str2,str3,str4,str5,str6,str7,str8,str9,str10,str11
,str12,str13,str14,str15,str16,str17,str18,str19;
;
try { 
cc = cit.citiaoka();
System.out.println("cccc:"+cc);
/*怎么优化(substring)取值*/
str1=cc.substring(1,2);
str2=cc.substring(4,5);
str3=cc.substring(7,8);
str4=cc.substring(10,11);
str5=cc.substring(13,14);
str6=cc.substring(16,17);
str7=cc.substring(19,20);
str8=cc.substring(22,23);   
str9=cc.substring(25,26);
str10=cc.substring(28,29);
str11=cc.substring(31,32); 
str12=cc.substring(34,35);
str13=cc.substring(37,38);
str14=cc.substring(40,41);
str15=cc.substring(43,44);
str16=cc.substring(46,47);
str17=cc.substring(49,50);
str18=cc.substring(52,53);
str19=cc.substring(55,56);
String temp=str1+str2+str3+str4+str5+str6+str7+str8+str9+str10+
str11+str12+str13+str14+str15+str16+str17+str18+str19;
  
System.out.println(temp + "\n");
  
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();



说明:ss.txt 文件数据格式 :33 32 35 34 35 36 37 38 39 37 31 32 37 34 35 37 32 38 38
执行结果:3254567897127457288