string.html
来自「维信SDK文档。源码要求为至少5个C或Java源码」· HTML 代码 · 共 773 行 · 第 1/3 页
HTML
773 行
<BR> Converts all of the characters in this String to lower case.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../widsets/api/String.html" title="class in ">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/String.html#toUpperCase()">toUpperCase</A></B>()</CODE><BR> Converts all of the characters in this String to upper case.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../widsets/api/String.html" title="class in ">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/String.html#trim()">trim</A></B>()</CODE><BR> Removes white space from both ends of this string.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class <A HREF="../../widsets/api/Object.html" title="class in ">Object</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../widsets/api/Object.html#toString()">toString</A>, <A HREF="../../widsets/api/Object.html#equals(Object)">equals</A>, <A HREF="../../widsets/api/Object.html#hashCode()">hashCode</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from </B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>equals, getClass, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="length()"><!-- --></A><H3>length</H3><PRE> int <B>length</B>()</PRE><DL><DD>Returns the length of this string. The length is equal to the number of 16-bit Unicode characters in the string.<P><DD><DL><DT><B>Returns:</B><DD>the length of the sequence of characters represented by this object.</DL></DD></DL><HR><A NAME="charAt(int)"><!-- --></A><H3>charAt</H3><PRE> char <B>charAt</B>(int index)</PRE><DL><DD>Returns the character at the specified index. An index ranges from <code>0</code> to <code>length() - 1</code>. The first character of the sequence is at index <code>0</code>, the next at index <code>1</code>, and so on, as for array indexing.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the character.<DT><B>Returns:</B><DD>the character at the specified index of this string. The first character is at index <code>0</code>.</DL></DD></DL><HR><A NAME="substring(int, int)"><!-- --></A><H3>substring</H3><PRE> <A HREF="../../widsets/api/String.html" title="class in ">String</A> <B>substring</B>(int beginIndex, int endIndex)</PRE><DL><DD>Returns a new string that is a substring of this string. The substring begins at the specified <code>beginIndex</code> and extends to the character at index <code>endIndex - 1</code>. Thus the length of the substring is <code>endIndex-beginIndex</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>beginIndex</CODE> - the beginning index, inclusive.<DD><CODE>endIndex</CODE> - the ending index, exclusive.<DT><B>Returns:</B><DD>the specified substring.</DL></DD></DL><HR><A NAME="startsWith(String)"><!-- --></A><H3>startsWith</H3><PRE> boolean <B>startsWith</B>(<A HREF="../../widsets/api/String.html" title="class in ">String</A> prefix)</PRE><DL><DD>Tests if this string starts with the specified prefix.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>prefix</CODE> - the prefix.<DT><B>Returns:</B><DD><code>true</code> if the character sequence represented by the argument is a prefix of the character sequence represented by this string; <code>false</code> otherwise. Note also that <code>true</code> will be returned if the argument is an empty string or is equal to this <code>String</code> object as determined by the <A HREF="../../widsets/api/Object.html#equals(Object)"><CODE>Object.equals(Object)</CODE></A> method.</DL></DD></DL><HR><A NAME="endsWith(String)"><!-- --></A><H3>endsWith</H3><PRE> boolean <B>endsWith</B>(<A HREF="../../widsets/api/String.html" title="class in ">String</A> suffix)</PRE><DL><DD>Tests if this string ends with the specified suffix.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>suffix</CODE> - the suffix.<DT><B>Returns:</B><DD><code>true</code> if the character sequence represented by the argument is a suffix of the character sequence represented by this object; <code>false</code> otherwise. Note that the result will be <code>true</code> if the argument is the empty string or is equal to this <code>String</code> object as determined by the <A HREF="../../widsets/api/Object.html#equals(Object)"><CODE>Object.equals(Object)</CODE></A> method.<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if <code>suffix</code> is <code>null</code>.</DL></DD></DL><HR><A NAME="indexOf(String, int)"><!-- --></A><H3>indexOf</H3><PRE> int <B>indexOf</B>(<A HREF="../../widsets/api/String.html" title="class in ">String</A> str, int fromIndex)</PRE><DL><DD>Returns the index within this string of the first occurrence of the specified substring, starting at the specified index. <p> There is no restriction on the value of <code>fromIndex</code>. If it is negative, it has the same effect as if it were zero: this entire string may be searched. If it is greater than the length of this string, it has the same effect as if it were equal to the length of this string: <code>-1</code> is returned.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>str</CODE> - the substring to search for.<DD><CODE>fromIndex</CODE> - the index to start the search from.<DT><B>Returns:</B><DD>If the string argument occurs as a substring within this object at a starting index no smaller than <code>fromIndex</code>, then the index of the first character of the first such substring is returned. If it does not occur as a substring starting at <code>fromIndex</code> or beyond, <code>-1</code> is returned.</DL></DD></DL><HR><A NAME="indexOf(char, int)"><!-- --></A><H3>indexOf</H3><PRE> int <B>indexOf</B>(char ch, int fromIndex)</PRE><DL><DD>Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index. <p> If a character with value <code>ch</code> occurs in the character sequence represented by this <code>String</code> object at an index no smaller than <code>fromIndex</code>, then the index of the first such occurrence is returned--that is, the smallest value <i>k</i> such that: <blockquote><pre> (this.charAt(<i>k</i>) == ch) && (<i>k</i> >= fromIndex) </pre></blockquote> is true. If no such character occurs in this string at or after position <code>fromIndex</code>, then <code>-1</code> is returned. <p> There is no restriction on the value of <code>fromIndex</code>. If it is negative, it has the same effect as if it were zero: this entire string may be searched. If it is greater than the length of this string, it has the same effect as if it were equal to the length of this string: <code>-1</code> is returned.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>ch</CODE> - a character.<DD><CODE>fromIndex</CODE> - the index to start the search from.<DT><B>Returns:</B><DD>the index of the first occurrence of the character in the character sequence represented by this object that is greater than or equal to <code>fromIndex</code>, or <code>-1</code> if the character does not occur.</DL></DD></DL><HR><A NAME="lastIndexOf(char, int)"><!-- --></A><H3>lastIndexOf</H3><PRE> int <B>lastIndexOf</B>(char ch, int fromIndex)</PRE><DL><DD>Returns the index within this string of the last occurrence of the specified character, searching backward starting at the specified index. That is, the index returned is the largest value <i>k</i> such that: <blockquote><pre> (this.charAt(k) == ch) && (k <= fromIndex) </pre></blockquote> is true.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>ch</CODE> - a character.<DD><CODE>fromIndex</CODE> - the index to start the search from. There is no restriction on the value of <code>fromIndex</code>. If it is greater than or equal to the length of this string, it has the same effect as if it were equal to one less than the length of this string: this entire string may be searched. If it is negative, it has the same effect as if it were -1: -1 is returned.<DT><B>Returns:</B><DD>the index of the last occurrence of the character in the character sequence represented by this object that is less than or equal to <code>fromIndex</code>, or <code>-1</code> if the character does not occur before that point.</DL></DD></DL><HR><A NAME="trim()"><!-- --></A><H3>trim</H3><PRE> <A HREF="../../widsets/api/String.html" title="class in ">String</A> <B>trim</B>()</PRE><DL><DD>Removes white space from both ends of this string. <p> If this <code>String</code> object represents an empty character sequence, or the first and last characters of character sequence represented by this <code>String</code> object both have codes greater than <code>'\u0020'</code> (the space character), then a reference to this <code>String</code> object is returned. <p> Otherwise, if there is no character with a code greater than <code>'\u0020'</code> in the string, then a new <code>String</code> object representing an empty string is created and returned.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?