📄 string.html
字号:
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> char</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#charAt(int)">charAt</A></B>(int index)</CODE><BR> Returns the character at the specified index.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#compareTo(java.lang.Object)">compareTo</A></B>(<A HREF="../../java/lang/Object.html">Object</A> o)</CODE><BR> Compares this String to another Object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#compareTo(java.lang.String)">compareTo</A></B>(<A HREF="../../java/lang/String.html">String</A> anotherString)</CODE><BR> Compares two strings lexicographically.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#compareToIgnoreCase(java.lang.String)">compareToIgnoreCase</A></B>(<A HREF="../../java/lang/String.html">String</A> str)</CODE><BR> Compares two strings lexicographically, ignoring case considerations.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#concat(java.lang.String)">concat</A></B>(<A HREF="../../java/lang/String.html">String</A> str)</CODE><BR> Concatenates the specified string to the end of this string.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#copyValueOf(char[])">copyValueOf</A></B>(char[] data)</CODE><BR> Returns a String that is equivalent to the specified character array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#copyValueOf(char[], int, int)">copyValueOf</A></B>(char[] data, int offset, int count)</CODE><BR> Returns a String that is equivalent to the specified character array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#endsWith(java.lang.String)">endsWith</A></B>(<A HREF="../../java/lang/String.html">String</A> suffix)</CODE><BR> Tests if this string ends with the specified suffix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#equals(java.lang.Object)">equals</A></B>(<A HREF="../../java/lang/Object.html">Object</A> anObject)</CODE><BR> Compares this string to the specified object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#equalsIgnoreCase(java.lang.String)">equalsIgnoreCase</A></B>(<A HREF="../../java/lang/String.html">String</A> anotherString)</CODE><BR> Compares this <code>String</code> to another <code>String</code>, ignoring case considerations.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> byte[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#getBytes()">getBytes</A></B>()</CODE><BR> Convert this <code>String</code> into bytes according to the platform's default character encoding, storing the result into a new byte array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#getBytes(int, int, byte[], int)">getBytes</A></B>(int srcBegin, int srcEnd, byte[] dst, int dstBegin)</CODE><BR> <B>Deprecated.</B> <I>This method does not properly convert characters into bytes. As of JDK 1.1, the preferred way to do this is via the <code>getBytes(String enc)</code> method, which takes a character-encoding name, or the <code>getBytes()</code> method, which uses the platform's default encoding.</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> byte[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#getBytes(java.lang.String)">getBytes</A></B>(<A HREF="../../java/lang/String.html">String</A> enc)</CODE><BR> Convert this <code>String</code> into bytes according to the specified character encoding, storing the result into a new byte array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#getChars(int, int, char[], int)">getChars</A></B>(int srcBegin, int srcEnd, char[] dst, int dstBegin)</CODE><BR> Copies characters from this string into the destination character array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#hashCode()">hashCode</A></B>()</CODE><BR> Returns a hashcode for this string.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#indexOf(int)">indexOf</A></B>(int ch)</CODE><BR> Returns the index within this string of the first occurrence of the specified character.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#indexOf(int, int)">indexOf</A></B>(int ch, int fromIndex)</CODE><BR> Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#indexOf(java.lang.String)">indexOf</A></B>(<A HREF="../../java/lang/String.html">String</A> str)</CODE><BR> 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> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#indexOf(java.lang.String, int)">indexOf</A></B>(<A HREF="../../java/lang/String.html">String</A> str, int fromIndex)</CODE><BR> 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> <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#intern()">intern</A></B>()</CODE><BR> Returns a canonical representation for the string object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#lastIndexOf(int)">lastIndexOf</A></B>(int ch)</CODE><BR> Returns the index within this string of the last occurrence of the specified character.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#lastIndexOf(int, int)">lastIndexOf</A></B>(int ch, int fromIndex)</CODE><BR> Returns the index within this string of the last occurrence of the specified character, searching backward starting at the specified index.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#lastIndexOf(java.lang.String)">lastIndexOf</A></B>(<A HREF="../../java/lang/String.html">String</A> str)</CODE><BR> 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> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#lastIndexOf(java.lang.String, int)">lastIndexOf</A></B>(<A HREF="../../java/lang/String.html">String</A> str, int fromIndex)</CODE><BR> 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> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#length()">length</A></B>()</CODE><BR> Returns the length of this string.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#regionMatches(boolean, int, java.lang.String, int, int)">regionMatches</A></B>(boolean ignoreCase, int toffset, <A HREF="../../java/lang/String.html">String</A> other, int ooffset, int len)</CODE><BR> Tests if two string regions are equal.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#regionMatches(int, java.lang.String, int, int)">regionMatches</A></B>(int toffset, <A HREF="../../java/lang/String.html">String</A> other, int ooffset, int len)</CODE><BR> Tests if two string regions are equal.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/lang/String.html#replace(char, char)">replace</A></B>(char oldChar, char newChar)</CODE><BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -