⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stringtools.html

📁 java base64
💻 HTML
📖 第 1 页 / 共 4 页
字号:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Print dollar currency, stored internally as scaled int.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#pluck(java.lang.String)">pluck</A></B>(java.lang.String&nbsp;s)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Extracts a number from a string, returns 0 if malformed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#quoteSQL(java.lang.String)">quoteSQL</A></B>(java.lang.String&nbsp;sql)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;used to prepare SQL string literals by doubling each embedded ' and wrapping in ' at each end.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#removeHead(java.lang.String, java.lang.String)">removeHead</A></B>(java.lang.String&nbsp;s,
           java.lang.String&nbsp;head)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remove an unwanted bit of text at the head end of a string if it is present.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#removeTail(java.lang.String, java.lang.String)">removeTail</A></B>(java.lang.String&nbsp;s,
           java.lang.String&nbsp;tail)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remove an unwanted bit of text at the tail end of a string if it is present.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#rep(char, int)">rep</A></B>(char&nbsp;c,
    int&nbsp;count)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Produce a String of a given repeating character.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#rightPad(java.lang.String, int, boolean)">rightPad</A></B>(java.lang.String&nbsp;s,
         int&nbsp;newLen,
         boolean&nbsp;chop)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pads the string out to the given length by applying blanks on the right.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#squish(java.lang.String)">squish</A></B>(java.lang.String&nbsp;s)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remove all spaces from a String.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#toBookTitleCase(java.lang.String)">toBookTitleCase</A></B>(java.lang.String&nbsp;s)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;convert to Book Title case, with first letter of each word capitalised.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#toHexString(int)">toHexString</A></B>(int&nbsp;h)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convert int to hex with lead zeroes</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;char</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#toLowerCase(char)">toLowerCase</A></B>(char&nbsp;c)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Quick replacement for Character.toLowerCase for use with English-only.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#toLowerCase(java.lang.String)">toLowerCase</A></B>(java.lang.String&nbsp;s)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Quick replacement for Character.toLowerCase for use with English-only.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#toLZ(int, int)">toLZ</A></B>(int&nbsp;i,
     int&nbsp;len)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convert an integer to a String, with left zeroes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#toLzHexString(int, int)">toLzHexString</A></B>(int&nbsp;value,
              int&nbsp;len)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;convert an integer value to unsigned hex with leading zeroes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#toString(java.awt.Color)">toString</A></B>(java.awt.Color&nbsp;c)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get #ffffff html hex number for a colour</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;char</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#toUpperCase(char)">toUpperCase</A></B>(char&nbsp;c)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Quick replacement for Character.toUpperCase for use with English-only.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#toUpperCase(java.lang.String)">toUpperCase</A></B>(java.lang.String&nbsp;s)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Quick replacement for Character.toUpperCase for use with English-only.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#trimLeading(java.lang.String)">trimLeading</A></B>(java.lang.String&nbsp;s)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes white space from beginning this string.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#trimLeading(java.lang.String, char)">trimLeading</A></B>(java.lang.String&nbsp;text,
            char&nbsp;c)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;trim leading characters there are on a string matching a given character.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#trimTrailing(java.lang.String)">trimTrailing</A></B>(java.lang.String&nbsp;s)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes white space from end this string.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/mindprod/common11/StringTools.html#trimTrailing(java.lang.String, char)">trimTrailing</A></B>(java.lang.String&nbsp;text,
             char&nbsp;c)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;trim trailing characters there are on a string matching a given character.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.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 java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<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="beep()"><!-- --></A><H3>
beep</H3>
<PRE>
public static void <B>beep</B>()</PRE>
<DL>
<DD>makeshift system beep if awt.Toolkit.beep is not available. Works also in JDK 1.02.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="canonical(java.lang.String)"><!-- --></A><H3>
canonical</H3>
<PRE>
public static java.lang.String <B>canonical</B>(java.lang.String&nbsp;s)</PRE>
<DL>
<DD>Convert String to canonical standard form. null -> "". Trims lead trail blanks.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>s</CODE> - String to be converted.
<DT><B>Returns:</B><DD>String in canonical form.</DL>
</DD>
</DL>
<HR>

<A NAME="condense(java.lang.String)"><!-- --></A><H3>
condense</H3>
<PRE>
public static java.lang.String <B>condense</B>(java.lang.String&nbsp;s)</PRE>
<DL>
<DD>Collapse multiple spaces in string down to a single space. Remove lead and trailing spaces.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>s</CODE> - String to strip of blanks.
<DT><B>Returns:</B><DD>String with all blanks, lead/trail/embedded removed.<DT><B>See Also:</B><DD><A HREF="../../../com/mindprod/common11/StringTools.html#squish(java.lang.String)"><CODE>squish(String)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="countInstances(java.lang.String, java.lang.String)"><!-- --></A><H3>
countInstances</H3>
<PRE>
public static int <B>countInstances</B>(java.lang.String&nbsp;page,
                                 java.lang.String&nbsp;lookFor)</PRE>
<DL>
<DD>Count how many times a String occurs on a page.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>page</CODE> - big String to look in.<DD><CODE>lookFor</CODE> - small String to look for and count instances.
<DT><B>Returns:</B><DD>number of times the String appears non-overlapping.</DL>
</DD>
</DL>
<HR>

<A NAME="countLeading(java.lang.String, char)"><!-- --></A><H3>
countLeading</H3>
<PRE>
public static int <B>countLeading</B>(java.lang.String&nbsp;text,
                               char&nbsp;c)</PRE>
<DL>
<DD>count of how many leading characters there are on a string matching a given character. It does not remove them.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>text</CODE> - text with possible leading characters, possibly empty, but not null.<DD><CODE>c</CODE> - the leading character of interest, usually ' ' or '\n'
<DT><B>Returns:</B><DD>count of leading matching characters, possibly 0.</DL>
</DD>
</DL>
<HR>

<A NAME="countTrailing(java.lang.String, char)"><!-- --></A><H3>
countTrailing</H3>
<PRE>
public static int <B>countTrailing</B>(java.lang.String&nbsp;text,
                                char&nbsp;c)</PRE>
<DL>
<DD>count of how many trailing characters there are on a string matching a given character. It does not remove them.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>text</CODE> - text with possible trailing characters, possibly empty, but not null.<DD><CODE>c</CODE> - the trailing character of interest, usually ' ' or '\n'

⌨️ 快捷键说明

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