#197 Please add method \\\"caselessCompare\\\" to \\\"String\\\" class

v3.2.0
closed
Classes (154)
5
2012-08-14
2007-06-24
No

Please add the method "caselessCompare" to the "String" class.

Discussion

  • Rick McGuire

    Rick McGuire - 2007-06-24

    Logged In: YES
    user_id=1125291
    Originator: NO

    Committed revision 501.

     
  • Rick McGuire

    Rick McGuire - 2007-06-24

    Logged In: YES
    user_id=1125291
    Originator: NO

    Here's the doc update.

    caselessCompare <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>
     
  • David Ashley

    David Ashley - 2007-06-25

    Logged In: YES
    user_id=931756
    Originator: NO

    Docs updated revision 505.

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks