string.html
来自「维信SDK文档。源码要求为至少5个C或Java源码」· HTML 代码 · 共 773 行 · 第 1/3 页
HTML
773 行
<p> Otherwise, let <i>k</i> be the index of the first character in the string whose code is greater than <code>'\u0020'</code>, and let <i>m</i> be the index of the last character in the string whose code is greater than <code>'\u0020'</code>. A new <code>String</code> object is created, representing the substring of this string that begins with the character at index <i>k</i> and ends with the character at index <i>m</i>-that is, the result of <code>this.substring(<i>k</i>, <i>m</i>+1)</code>. <p> This method may be used to trim whitespace from the beginning and end of a string; in fact, it trims all ASCII control characters as well.<P><DD><DL><DT><B>Returns:</B><DD>this string, with white space removed from the front and end.</DL></DD></DL><HR><A NAME="toUpperCase()"><!-- --></A><H3>toUpperCase</H3><PRE> <A HREF="../../widsets/api/String.html" title="class in ">String</A> <B>toUpperCase</B>()</PRE><DL><DD>Converts all of the characters in this String to upper case.<P><DD><DL><DT><B>Returns:</B><DD>the String, converted to uppercase.<DT><B>See Also:</B><DD><A HREF="../../widsets/api/String.html#toLowerCase()"><CODE>toLowerCase()</CODE></A></DL></DD></DL><HR><A NAME="toLowerCase()"><!-- --></A><H3>toLowerCase</H3><PRE> <A HREF="../../widsets/api/String.html" title="class in ">String</A> <B>toLowerCase</B>()</PRE><DL><DD>Converts all of the characters in this String to lower case.<P><DD><DL><DT><B>Returns:</B><DD>the String, converted to lowercase.<DT><B>See Also:</B><DD><A HREF="../../widsets/api/String.html#toUpperCase()"><CODE>toUpperCase()</CODE></A></DL></DD></DL><HR><A NAME="replace(char, char)"><!-- --></A><H3>replace</H3><PRE> <A HREF="../../widsets/api/String.html" title="class in ">String</A> <B>replace</B>(char oldChar, char newChar)</PRE><DL><DD>Returns a new string resulting from replacing all occurrences of <code>oldChar</code> in this string with <code>newChar</code>. <p> If the character <code>oldChar</code> does not occur in the character sequence represented by this <code>String</code> object, then a reference to this <code>String</code> object is returned. Otherwise, a new <code>String</code> object is created that represents a character sequence identical to the character sequence represented by this <code>String</code> object, except that every occurrence of <code>oldChar</code> is replaced by an occurrence of <code>newChar</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>oldChar</CODE> - the old character.<DD><CODE>newChar</CODE> - the new character.<DT><B>Returns:</B><DD>a string derived from this string by replacing every occurrence of <code>oldChar</code> with <code>newChar</code>.</DL></DD></DL><HR><A NAME="compareTo(String)"><!-- --></A><H3>compareTo</H3><PRE> int <B>compareTo</B>(<A HREF="../../widsets/api/String.html" title="class in ">String</A> str)</PRE><DL><DD>Compares two strings lexicographically. The comparison is based on the Unicode value of each character in the strings. The character sequence represented by this <code>String</code> object is compared lexicographically to the character sequence represented by the argument string. The result is a negative integer if this <code>String</code> object lexicographically precedes the argument string. The result is a positive integer if this <code>String</code> object lexicographically follows the argument string. The result is zero if the strings are equal; <code>compareTo</code> returns <code>0</code> exactly when the <A HREF="../../widsets/api/Object.html#equals(Object)"><CODE>Object.equals(Object)</CODE></A> method would return <code>true</code>. <p> This is the definition of lexicographic ordering. If two strings are different, then either they have different characters at some index that is a valid index for both strings, or their lengths are different, or both. If they have different characters at one or more index positions, let <i>k</i> be the smallest such index; then the string whose character at position <i>k</i> has the smaller value, as determined by using the < operator, lexicographically precedes the other string. In this case, <code>compareTo</code> returns the difference of the two character values at position <code>k</code> in the two string -- that is, the value: <blockquote><pre> this.charAt(k)-str.charAt(k) </pre></blockquote> If there is no index position at which they differ, then the shorter string lexicographically precedes the longer string. In this case, <code>compareTo</code> returns the difference of the lengths of the strings -- that is, the value: <blockquote><pre> this.length()-str.length() </pre></blockquote><P><DD><DL><DT><B>Parameters:</B><DD><CODE>str</CODE> - the <code>String</code> to be compared.<DT><B>Returns:</B><DD>the value <code>0</code> if the argument string is equal to this string; a value less than <code>0</code> if this string is lexicographically less than the string argument; and a value greater than <code>0</code> if this string is lexicographically greater than the string argument.</DL></DD></DL><HR><A NAME="compareToIgnoreCase(String)"><!-- --></A><H3>compareToIgnoreCase</H3><PRE> int <B>compareToIgnoreCase</B>(<A HREF="../../widsets/api/String.html" title="class in ">String</A> str)</PRE><DL><DD>Compares two strings lexicographically, ignoring case differences. This method returns an integer whose sign is that of calling compareTo with normalized versions of the strings where case differences have been eliminated by converting each character to lower case.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>str</CODE> - the String to be compared.<DT><B>Returns:</B><DD>a negative integer, zero, or a positive integer as the the specified String is greater than, equal to, or less than this String, ignoring case considerations.</DL></DD></DL><HR><A NAME="equalsIgnoreCase(String)"><!-- --></A><H3>equalsIgnoreCase</H3><PRE> boolean <B>equalsIgnoreCase</B>(<A HREF="../../widsets/api/String.html" title="class in ">String</A> str)</PRE><DL><DD>Compares this String to another String, ignoring case considerations. Two strings are considered equal ignoring case if they are of the same length, and corresponding characters in the two strings are equal ignoring case.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>str</CODE> - the String to compare this String against.<DT><B>Returns:</B><DD><code>true</code> if the argument is not <code>null</code> and the Strings are equal, ignoring case; <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="operator_get(int)"><!-- --></A><H3>operator_get</H3><PRE> char <B>operator_get</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="explode(String)"><!-- --></A><H3>explode</H3><PRE> <A HREF="../../widsets/api/List.html" title="class in ">List</A> <B>explode</B>(<A HREF="../../widsets/api/String.html" title="class in ">String</A> divider)</PRE><DL><DD>Splits this String into list of substrings according to given divider string.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>divider</CODE> - Divider string<DT><B>Returns:</B><DD>List of elements</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../widsets/api/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../widsets/api/Store.html" title="class in "><B>PREV CLASS</B></A> <A HREF="../../widsets/api/Style.html" title="class in "><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?widsets/api/String.html" target="_top"><B>FRAMES</B></A> <A HREF="String.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?