日期:2014-05-20 浏览次数:21198 次
public class dsf {
/**
* @param args
*/
public static void main(String[] args) {
String re,restr="";
int tr=0,i;
String str="1001-1002-1003-1004-1005";
byte[] buf= str.getBytes();
for(i=0;i<buf.length;i++)
{
if(buf[i]=='-')
{
re=new String(buf,tr,i);
System.out.println(re+" "+tr+" "+i);
tr=i+1;
}
}
}
}