stringbuilder.html

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

HTML
1,401
字号
 execution of the <code>append</code> method. Then the character at index <i>k</i> in this character sequence becomes equal to the character at index <i>k</i> in this sequence, if <i>k</i> is less than <i>n</i>; otherwise, it is equal to the character at index  <i>k+start-n</i> in the argument <code>s</code>. <p> If <code>s</code> is <code>null</code>, then this method appends characters as if the s parameter was a sequence containing the four characters <code>"null"</code>.<P><DD><DL><DT><B>指定者:</B><DD>接口 <CODE><A HREF="Appendable.html" title="java.lang 中的接口">Appendable</A></CODE> 中的 <CODE><A HREF="Appendable.html#append(java.lang.CharSequence, int, int)">append</A></CODE></DL></DD><DD><DL><DT><B>参数:</B><DD><CODE>s</CODE> - the sequence to append.<DD><CODE>start</CODE> - the starting index of the subsequence to be appended.<DD><CODE>end</CODE> - the end index of the subsequence to be appended.<DT><B>返回:</B><DD>a reference to this object.<DT><B>抛出:</B><DD><CODE><A HREF="IndexOutOfBoundsException.html" title="java.lang 中的类">IndexOutOfBoundsException</A></CODE> - if                  <code>start</code> or <code>end</code> are negative, or             <code>start</code> is greater than <code>end</code> or             <code>end</code> is greater than <code>s.length()</code></DL></DD></DL><HR><A NAME="append(char[])"><!-- --></A><H3>append</H3><PRE>public <A HREF="StringBuilder.html" title="java.lang 中的类">StringBuilder</A> <B>append</B>(char[]&nbsp;str)</PRE><DL><DD>Appends the string representation of the <code>char</code> array  argument to this sequence.  <p> The characters of the array argument are appended, in order, to  the contents of this sequence. The length of this sequence increases by the length of the argument.  <p> The overall effect is exactly as if the argument were converted to  a string by the method <A HREF="String.html#valueOf(char[])"><CODE>String.valueOf(char[])</CODE></A> and the  characters of that string were then <A HREF="StringBuilder.html#append(java.lang.String)"><CODE>appended</CODE></A>  to this character sequence.<P><DD><DL></DL></DD><DD><DL><DT><B>参数:</B><DD><CODE>str</CODE> - the characters to be appended.<DT><B>返回:</B><DD>a reference to this object.</DL></DD></DL><HR><A NAME="append(char[], int, int)"><!-- --></A><H3>append</H3><PRE>public <A HREF="StringBuilder.html" title="java.lang 中的类">StringBuilder</A> <B>append</B>(char[]&nbsp;str,                            int&nbsp;offset,                            int&nbsp;len)</PRE><DL><DD>Appends the string representation of a subarray of the <code>char</code> array argument to this sequence. <p> Characters of the <code>char</code> array <code>str</code>, starting at index <code>offset</code>, are appended, in order, to the contents of this sequence. The length of this sequence increases by the value of <code>len</code>. <p> The overall effect is exactly as if the arguments were converted to a string by the method <A HREF="String.html#valueOf(char[], int, int)"><CODE>String.valueOf(char[],int,int)</CODE></A> and the characters of that string were then <A HREF="StringBuilder.html#append(java.lang.String)"><CODE>appended</CODE></A> to this character sequence.<P><DD><DL></DL></DD><DD><DL><DT><B>参数:</B><DD><CODE>str</CODE> - the characters to be appended.<DD><CODE>offset</CODE> - the index of the first <code>char</code> to append.<DD><CODE>len</CODE> - the number of <code>char</code>s to append.<DT><B>返回:</B><DD>a reference to this object.</DL></DD></DL><HR><A NAME="append(boolean)"><!-- --></A><H3>append</H3><PRE>public <A HREF="StringBuilder.html" title="java.lang 中的类">StringBuilder</A> <B>append</B>(boolean&nbsp;b)</PRE><DL><DD>Appends the string representation of the <code>boolean</code>  argument to the sequence. <p> The argument is converted to a string as if by the method  <code>String.valueOf</code>, and the characters of that  string are then appended to this sequence.<P><DD><DL></DL></DD><DD><DL><DT><B>参数:</B><DD><CODE>b</CODE> - a <code>boolean</code>.<DT><B>返回:</B><DD>a reference to this object.<DT><B>另请参见:</B><DD><A HREF="String.html#valueOf(boolean)"><CODE>String.valueOf(boolean)</CODE></A>, <A HREF="StringBuilder.html#append(java.lang.String)"><CODE>append(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="append(char)"><!-- --></A><H3>append</H3><PRE>public <A HREF="StringBuilder.html" title="java.lang 中的类">StringBuilder</A> <B>append</B>(char&nbsp;c)</PRE><DL><DD>Appends the string representation of the <code>char</code>  argument to this sequence.  <p> The argument is appended to the contents of this sequence.  The length of this sequence increases by <code>1</code>.  <p> The overall effect is exactly as if the argument were converted to  a string by the method <A HREF="String.html#valueOf(char)"><CODE>String.valueOf(char)</CODE></A> and the character  in that string were then <A HREF="StringBuilder.html#append(java.lang.String)"><CODE>appended</CODE></A> to this  character sequence.<P><DD><DL><DT><B>指定者:</B><DD>接口 <CODE><A HREF="Appendable.html" title="java.lang 中的接口">Appendable</A></CODE> 中的 <CODE><A HREF="Appendable.html#append(char)">append</A></CODE></DL></DD><DD><DL><DT><B>参数:</B><DD><CODE>c</CODE> - a <code>char</code>.<DT><B>返回:</B><DD>a reference to this object.</DL></DD></DL><HR><A NAME="append(int)"><!-- --></A><H3>append</H3><PRE>public <A HREF="StringBuilder.html" title="java.lang 中的类">StringBuilder</A> <B>append</B>(int&nbsp;i)</PRE><DL><DD>Appends the string representation of the <code>int</code>  argument to this sequence.  <p> The argument is converted to a string as if by the method  <code>String.valueOf</code>, and the characters of that  string are then appended to this sequence.<P><DD><DL></DL></DD><DD><DL><DT><B>参数:</B><DD><CODE>i</CODE> - an <code>int</code>.<DT><B>返回:</B><DD>a reference to this object.<DT><B>另请参见:</B><DD><A HREF="String.html#valueOf(int)"><CODE>String.valueOf(int)</CODE></A>, <A HREF="StringBuilder.html#append(java.lang.String)"><CODE>append(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="append(long)"><!-- --></A><H3>append</H3><PRE>public <A HREF="StringBuilder.html" title="java.lang 中的类">StringBuilder</A> <B>append</B>(long&nbsp;lng)</PRE><DL><DD>Appends the string representation of the <code>long</code>  argument to this sequence. <p> The argument is converted to a string as if by the method  <code>String.valueOf</code>, and the characters of that  string are then appended to this sequence.<P><DD><DL></DL></DD><DD><DL><DT><B>参数:</B><DD><CODE>lng</CODE> - a <code>long</code>.<DT><B>返回:</B><DD>a reference to this object.<DT><B>另请参见:</B><DD><A HREF="String.html#valueOf(long)"><CODE>String.valueOf(long)</CODE></A>, <A HREF="StringBuilder.html#append(java.lang.String)"><CODE>append(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="append(float)"><!-- --></A><H3>append</H3><PRE>public <A HREF="StringBuilder.html" title="java.lang 中的类">StringBuilder</A> <B>append</B>(float&nbsp;f)</PRE><DL><DD>Appends the string representation of the <code>float</code>  argument to this sequence. <p> The argument is converted to a string as if by the method  <code>String.valueOf</code>, and the characters of that  string are then appended to this string sequence.<P><DD><DL></DL></DD><DD><DL><DT><B>参数:</B><DD><CODE>f</CODE> - a <code>float</code>.<DT><B>返回:</B><DD>a reference to this object.<DT><B>另请参见:</B><DD><A HREF="String.html#valueOf(float)"><CODE>String.valueOf(float)</CODE></A>, <A HREF="StringBuilder.html#append(java.lang.String)"><CODE>append(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="append(double)"><!-- --></A><H3>append</H3><PRE>public <A HREF="StringBuilder.html" title="java.lang 中的类">StringBuilder</A> <B>append</B>(double&nbsp;d)</PRE><DL><DD>Appends the string representation of the <code>double</code>  argument to this sequence. <p> The argument is converted to a string as if by the method  <code>String.valueOf</code>, and the characters of that  string are then appended to this sequence.<P><DD><DL></DL></DD><DD><DL><DT><B>参数:</B><DD><CODE>d</CODE> - a <code>double</code>.<DT><B>返回:</B><DD>a reference to this object.<DT><B>另请参见:</B><DD><A HREF="String.html#valueOf(double)"><CODE>String.valueOf(double)</CODE></A>, <A HREF="StringBuilder.html#append(java.lang.String)"><CODE>append(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="appendCodePoint(int)"><!-- --></A><H3>appendCodePoint</H3><PRE>public <A HREF="StringBuilder.html" title="java.lang 中的类">StringBuilder</A> <B>appendCodePoint</B>(int&nbsp;codePoint)</PRE><DL><DD>Appends the string representation of the <code>codePoint</code> argument to this sequence. <p> The argument is appended to the contents of this sequence. The length of this sequence increases by <A HREF="Character.html#charCount(int)"><CODE>Character.charCount(codePoint)</CODE></A>. <p> The overall effect is exactly as if the argument were converted to a <code>char</code> array by the method <A HREF="Character.html#toChars(int)"><CODE>Character.toChars(int)</CODE></A> and the character in that array were then <A HREF="StringBuilder.html#append(char[])"><CODE>appended</CODE></A> to this character sequence.<P><DD><DL></DL></DD><DD><DL><DT><B>参数:</B><DD><CODE>codePoint</CODE> - a Unicode code point<DT><B>返回:</B><DD>a reference to this object.<DT><B>从以下版本开始:</B></DT>  <DD>1.5</DD></DL></DD></DL><HR><A NAME="delete(int, int)"><!-- --></A><H3>delete</H3><PRE>public <A HREF="StringBuilder.html" title="java.lang 中的类">StringBuilder</A> <B>delete</B>(int&nbsp;start,                            int&nbsp;end)</PRE><DL><DD>Removes the characters in a substring of this sequence. The substring begins at the specified <code>start</code> and extends to the character at index <code>end - 1</code> or to the end of the sequence if no such character exists. If <code>start</code> is equal to <code>end</code>, no changes are made.<P><DD><DL></DL></DD><DD><DL><DT><B>参数:</B><DD><CODE>start</CODE> - The beginning index, inclusive.<DD><CODE>end</CODE> - The ending index, exclusive.<DT><B>返回:</B><DD>This object.<DT><B>抛出:</B><DD><CODE><A HREF="StringIndexOutOfBoundsException.html" title="java.lang 中的类">StringIndexOutOfBoundsException</A></CODE> - if <code>start</code>             is negative, greater than <code>length()</code>, or                   greater than <code>end</code>.</DL></DD></DL><HR><A NAME="deleteCharAt(int)"><!-- --></A><H3>deleteCharAt</H3><PRE>

⌨️ 快捷键说明

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