日期:2014-05-17 浏览次数:20754 次
<%
StringBuffer s=new StringBuffer("He is also a student.");
out.println("StringBuffer字符串s为:"+s+"<br>");
out.println("s的长度为:"+s.length()+"<br>");
out.println("s的容量为:"+s.capacity()+"<br>");
out.println("s的第3个字符为:"+s.charAt(2)+"<br>");
out.println("s的第3至第6个字符的子串为:"+s.substring(2,5)+"<br>");
out.println("s末尾追加串后为:"+s.append("Me,too.")+"<br>");
out.println("s翻转后的串为:"+s.reverse()+"<br>");
%>