<title>caselessCompare</title>
<indexterm><primary>caselessCompare method</primary>
<secondary>of String class</secondary></indexterm>
<indexterm><primary>method</primary>
<secondary>compare method</secondary>
<tertiary>of String class</tertiary></indexterm>
<indexterm><primary>comparisons</primary>
<secondary>of strings</secondary></indexterm>
<indexterm><primary>finding</primary>
<secondary>mismatch using caselessCompare</secondary></indexterm>
<programlisting>
>-caselessCompare(string-+------+-)-----------------------------------><
+-,pad-+
]]>
</programlisting>
<para>Returns <computeroutput>0</computeroutput> if the argument
<emphasis role="italic">string</emphasis> is identical to the
receiving string using a caseless comparison.
Otherwise, returns the position of the first character that
does not match. The shorter string is padded on the right with
<emphasis role="italic">pad</emphasis> if
necessary. The default <emphasis role="italic">pad</emphasis> character is a
blank.</para>
<para><emphasis role="bold">Examples:</emphasis></para>
<indexterm><primary>examples</primary>
<secondary>compare method</secondary></indexterm>
<programlisting>
0
"abc"~caselessCompare("Ak") -> 2
"ab "~caselessCompare("AB") -> 0
"AB "~caselessCompare("ab"," ") -> 0
"ab "~caselesscompare("ab","x") -> 3
"abXX "~caselesscompare("ab","x") -> 5
]]>
</programlisting>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=1125291
Originator: NO
Committed revision 501.
Logged In: YES
user_id=1125291
Originator: NO
Here's the doc update.
Logged In: YES
user_id=931756
Originator: NO
Docs updated revision 505.