stringbuffer.html

来自「API資料大全」· HTML 代码 · 共 1,387 行 · 第 1/5 页

HTML
1,387
字号
</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="../../java/lang/StringBuffer.html#charAt(int)">charAt</A></B>(int&nbsp;index)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The specified character of the sequence currently represented by  the string buffer, as indicated by the <code>index</code> argument,  is returned.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/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 <code>StringBuffer</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#deleteCharAt(int)">deleteCharAt</A></B>(int&nbsp;index)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes the character at the specified position in this <code>StringBuffer</code> (shortening the <code>StringBuffer</code> by one character).</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="../../java/lang/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 of the buffer 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="../../java/lang/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 string buffer 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;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/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 string buffer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/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 string buffer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/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 string buffer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/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 string buffer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/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 string buffer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/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 string buffer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/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 string buffer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/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 string buffer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#insert(int, java.lang.Object)">insert</A></B>(int&nbsp;offset,       <A HREF="../../java/lang/Object.html">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 string buffer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#insert(int, java.lang.String)">insert</A></B>(int&nbsp;offset,       <A HREF="../../java/lang/String.html">String</A>&nbsp;str)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inserts the string into this string buffer.</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="../../java/lang/StringBuffer.html#length()">length</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the length (character count) of this string buffer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#replace(int, int, java.lang.String)">replace</A></B>(int&nbsp;start,        int&nbsp;end,        <A HREF="../../java/lang/String.html">String</A>&nbsp;str)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Replaces the characters in a substring of this <code>StringBuffer</code> 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="../../java/lang/StringBuffer.html">StringBuffer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#reverse()">reverse</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The character sequence contained in this string buffer is  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="../../java/lang/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 of this string buffer is set  to <code>ch</code>.</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="../../java/lang/StringBuffer.html#setLength(int)">setLength</A></B>(int&nbsp;newLength)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the length of this String buffer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#substring(int)">substring</A></B>(int&nbsp;start)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new <code>String</code> that contains a subsequence of characters currently contained in this <code>StringBuffer</code>.The  substring begins at the specified index and extends to the end of the <code>StringBuffer</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#substring(int, int)">substring</A></B>(int&nbsp;start,          int&nbsp;end)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new <code>String</code> that contains a subsequence of characters currently contained in this <code>StringBuffer</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/StringBuffer.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts to a string representing the data in this string buffer.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="StringBuffer()"><!-- --></A><H3>StringBuffer</H3><PRE>public <B>StringBuffer</B>()</PRE><DL><DD>Constructs a string buffer with no characters in it and an  initial capacity of 16 characters.</DL><HR><A NAME="StringBuffer(int)"><!-- --></A><H3>StringBuffer</H3><PRE>public <B>StringBuffer</B>(int&nbsp;length)</PRE><DL><DD>Constructs a string buffer with no characters in it and an  initial capacity specified by the <code>length</code> argument.<DD><DL><DT><B>Parameters:</B><DD><CODE>length</CODE> - the initial capacity.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NegativeArraySizeException.html">NegativeArraySizeException</A></CODE> - if the <code>length</code>               argument is less than <code>0</code>.</DL></DD></DL><HR><A NAME="StringBuffer(java.lang.String)"><!-- --></A><H3>StringBuffer</H3><PRE>

⌨️ 快捷键说明

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