stringbuffer.html

来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 533 行 · 第 1/2 页

HTML
533
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_03) on Wed Nov 02 09:52:51 CST 2005 --><META http-equiv="Content-Type" content="text/html; charset=gb2312"><TITLE>类 java.lang.StringBuffer 的使用 (Java 2 Platform SE 5.0)</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="类 java.lang.StringBuffer 的使用 (Java 2 Platform SE 5.0)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="跳过导航链接"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../StringBuffer.html" title="java.lang 中的类"><FONT CLASS="NavBarFont1"><B>类</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>使用</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Standard&nbsp;Ed. 5.0</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;上一个&nbsp;&nbsp;下一个</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html@java_2Flang_2F_2Fclass-useStringBuffer.html" target="_top"><B>框架</B></A>  &nbsp;&nbsp;<A HREF="StringBuffer.html" target="_top"><B>无框架</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>所有类</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../allclasses-noframe.html"><B>所有类</B></A></NOSCRIPT></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><CENTER><H2><B>类 java.lang.StringBuffer<br>的使用</B></H2></CENTER><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">使用 <A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A> 的软件包</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><A HREF="#java.lang"><B>java.lang</B></A></TD><TD>提供利用 Java 编程语言进行程序设计的基础类。&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><A HREF="#java.util.regex"><B>java.util.regex</B></A></TD><TD>用于匹配字符序列与正则表达式指定模式的类。&nbsp;</TD></TR></TABLE>&nbsp;<P><A NAME="java.lang"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><A HREF="../package-summary.html">java.lang</A> 中 <A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A> 的使用</FONT></TH></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">返回 <A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A> 的 <A HREF="../package-summary.html">java.lang</A> 中的方法</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#append(boolean)">append</A></B>(boolean&nbsp;b)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#append(char)">append</A></B>(char&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#append(char[])">append</A></B>(char[]&nbsp;str)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#append(char[], int, int)">append</A></B>(char[]&nbsp;str,       int&nbsp;offset,       int&nbsp;len)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#append(java.lang.CharSequence)">append</A></B>(<A HREF="../CharSequence.html" title="java.lang 中的接口">CharSequence</A>&nbsp;s)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将指定的 <code>CharSequence</code> 追加到该序列。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#append(java.lang.CharSequence, int, int)">append</A></B>(<A HREF="../CharSequence.html" title="java.lang 中的接口">CharSequence</A>&nbsp;s,       int&nbsp;start,       int&nbsp;end)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#append(double)">append</A></B>(double&nbsp;d)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#append(float)">append</A></B>(float&nbsp;f)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#append(int)">append</A></B>(int&nbsp;i)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#append(long)">append</A></B>(long&nbsp;lng)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#append(java.lang.Object)">append</A></B>(<A HREF="../Object.html" title="java.lang 中的类">Object</A>&nbsp;obj)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#append(java.lang.String)">append</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;str)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#append(java.lang.StringBuffer)">append</A></B>(<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A>&nbsp;sb)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将指定的 <tt>StringBuffer</tt> 追加到此序列中。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#appendCodePoint(int)">appendCodePoint</A></B>(int&nbsp;codePoint)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#delete(int, int)">delete</A></B>(int&nbsp;start,       int&nbsp;end)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#deleteCharAt(int)">deleteCharAt</A></B>(int&nbsp;index)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#insert(int, boolean)">insert</A></B>(int&nbsp;offset,       boolean&nbsp;b)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD><TD><CODE><B>StringBuffer.</B><B><A HREF="../StringBuffer.html#insert(int, char)">insert</A></B>(int&nbsp;offset,       char&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../StringBuffer.html" title="java.lang 中的类">StringBuffer</A></CODE></FONT></TD>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?