StringBuffer问题
int i,j,p;
char dw[]={'1','2','3'};
StringBuffer dx=new StringBuffer("ldjkfhsjkf.as");
for(i=0;i<dx.length();i++)
{
if(dx.charAt(i)=='.')
{
p=i;
}
}
System.out.println("dx.length()="+dx.length());
for(i=p+1,j=0;i<dx.length();i++,j++)
{
System.out.print("i="+i+"j="+j);
System.out.print(dx.charAt(i));
System.out.println(dw[j]);
//dx.insert(i,dw[j]); 这句是想把'1','2'插到'.'后面的a和s后面,可是加了这句就下标越界,搞不懂!
}
[此贴子已经被作者于2007-6-5 13:36:30编辑过]