日期:2014-05-20  浏览次数:20729 次

java append 一个疑问
		char [] text = {'i','s',' ','e','x','a','c','t','l','y'};
StringBuffer buf = new StringBuffer();
buf.append(text, 2, 8);
System.out.println(buf);


这个代码为什么会输出 exactly?我是像下面这样理解的,很明显不对呀,我想问问csdn的朋友,为什么会输出exactly

char [] text = {'i','s',' ','e','x','a','c','t','l','y'};
                 0   1   2   3   4   5   6   7   8   9 

------解决方案--------------------
8的意思是截取8个字符
不是截取到第八个