stringbuffer.html

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

HTML
1,470
字号
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Appends the string representation of the <code>codePoint</code> argument to this sequence.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="StringBuffer.html#capacity()">capacity</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current capacity.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;char</CODE></FONT></TD><TD><CODE><B><A HREF="StringBuffer.html#charAt(int)">charAt</A></B>(int&nbsp;index)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>char</code> value in this sequence at the specified index.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="StringBuffer.html#codePointAt(int)">codePointAt</A></B>(int&nbsp;index)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the character (Unicode code point) at the specified index.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="StringBuffer.html#codePointBefore(int)">codePointBefore</A></B>(int&nbsp;index)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the character (Unicode code point) before the specified index.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="StringBuffer.html#codePointCount(int, int)">codePointCount</A></B>(int&nbsp;beginIndex,               int&nbsp;endIndex)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of Unicode code points in the specified text range of this sequence.</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><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;Removes the characters in a substring of this sequence.</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><A HREF="StringBuffer.html#deleteCharAt(int)">deleteCharAt</A></B>(int&nbsp;index)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes the <code>char</code> at the specified position in this sequence.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="StringBuffer.html#ensureCapacity(int)">ensureCapacity</A></B>(int&nbsp;minimumCapacity)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ensures that the capacity is at least equal to the specified minimum.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="StringBuffer.html#getChars(int, int, char[], int)">getChars</A></B>(int&nbsp;srcBegin,         int&nbsp;srcEnd,         char[]&nbsp;dst,         int&nbsp;dstBegin)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Characters are copied from this sequence into the  destination character array <code>dst</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="StringBuffer.html#indexOf(java.lang.String)">indexOf</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;Returns the index within this string of the first occurrence of the specified substring.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="StringBuffer.html#indexOf(java.lang.String, int)">indexOf</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;str,        int&nbsp;fromIndex)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.</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><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;Inserts the string representation of the <code>boolean</code>  argument into this sequence.</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><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;Inserts the string representation of the <code>char</code>  argument into this sequence.</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><A HREF="StringBuffer.html#insert(int, char[])">insert</A></B>(int&nbsp;offset,       char[]&nbsp;str)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string representation of the <code>char</code> array  argument into this sequence.</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><A HREF="StringBuffer.html#insert(int, char[], int, int)">insert</A></B>(int&nbsp;index,       char[]&nbsp;str,       int&nbsp;offset,       int&nbsp;len)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string representation of a subarray of the <code>str</code> array argument into this sequence.</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><A HREF="StringBuffer.html#insert(int, java.lang.CharSequence)">insert</A></B>(int&nbsp;dstOffset,       <A HREF="CharSequence.html" title="java.lang 中的接口">CharSequence</A>&nbsp;s)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the specified <code>CharSequence</code> into this sequence.</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><A HREF="StringBuffer.html#insert(int, java.lang.CharSequence, int, int)">insert</A></B>(int&nbsp;dstOffset,       <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;Inserts a subsequence of the specified <code>CharSequence</code> into this sequence.</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><A HREF="StringBuffer.html#insert(int, double)">insert</A></B>(int&nbsp;offset,       double&nbsp;d)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string representation of the <code>double</code>  argument into this sequence.</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><A HREF="StringBuffer.html#insert(int, float)">insert</A></B>(int&nbsp;offset,       float&nbsp;f)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string representation of the <code>float</code>  argument into this sequence.</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><A HREF="StringBuffer.html#insert(int, int)">insert</A></B>(int&nbsp;offset,       int&nbsp;i)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string representation of the second <code>int</code>  argument into this sequence.</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><A HREF="StringBuffer.html#insert(int, long)">insert</A></B>(int&nbsp;offset,       long&nbsp;l)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string representation of the <code>long</code>  argument into this sequence.</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><A HREF="StringBuffer.html#insert(int, java.lang.Object)">insert</A></B>(int&nbsp;offset,       <A HREF="Object.html" title="java.lang 中的类">Object</A>&nbsp;obj)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string representation of the <code>Object</code>  argument into this character sequence.</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><A HREF="StringBuffer.html#insert(int, java.lang.String)">insert</A></B>(int&nbsp;offset,       <A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;str)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string into this character sequence.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="StringBuffer.html#lastIndexOf(java.lang.String)">lastIndexOf</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;Returns the index within this string of the rightmost occurrence of the specified substring.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="StringBuffer.html#lastIndexOf(java.lang.String, int)">lastIndexOf</A></B>(<A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;str,            int&nbsp;fromIndex)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index within this string of the last occurrence of the specified substring.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="StringBuffer.html#length()">length</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the length (character count).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="StringBuffer.html#offsetByCodePoints(int, int)">offsetByCodePoints</A></B>(int&nbsp;index,                   int&nbsp;codePointOffset)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index within this sequence that is offset from the given <code>index</code> by <code>codePointOffset</code> code points.</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><A HREF="StringBuffer.html#replace(int, int, java.lang.String)">replace</A></B>(int&nbsp;start,        int&nbsp;end,        <A HREF="String.html" title="java.lang 中的类">String</A>&nbsp;str)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Replaces the characters in a substring of this sequence with characters in the specified <code>String</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><A HREF="StringBuffer.html#reverse()">reverse</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Causes this character sequence to be replaced by the reverse of the sequence.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="StringBuffer.html#setCharAt(int, char)">setCharAt</A></B>(int&nbsp;index,          char&nbsp;ch)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The character at the specified index is set to <code>ch</code>.</TD>

⌨️ 快捷键说明

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