equalsIgnoreCase()

The strLib.equalsIgnoreCase()system function compares two strings to determine if they are equal, ignoring case differences. It returns “true” if the strings are equal when ignoring case differences. Otherwise,it returns false.

Syntax

   strLib.equalsIgnoreCase(
             string1 STRING | CHAR | DBCHAR | MBCHAR | UNICODE In, 
             string2 STRING | CHAR | DBCHAR | MBCHAR | UNICODE In)
  returns (result BOOLEAN)
string1

Input can be any value that is assignment compatible with any of the above types.

string2

Input can be any value that is assignment compatible with any of the above types.

result

It returns “true” if the string1is equal to the string2, “false” otherwise.

Example

   function main()
       myString String      = “CUSTOMER”;
       strEqual String      = “customer”;
       myChar Char(8)       = “Customer”;
       charEqual Char(6)    = “Customer”;
       myUni Unicode(8)     = “CUSTOMER”;
       uniEqual Unicode(8)  = “CUSTOMer”;

       sysLib.writeStdout(“Is ‘CUSTOMER’ equal to ‘customer’? “ + strLib.equalIgnoreCase(myStr, strEqual)); 
       sysLib.writeStdout(“Is ‘Customer’ equal to ‘Customer’? “ + strLib.equalIgnoreCase(myChar, charEqual)); 
       sysLib.writeStdout(“Is ‘CUSTOMER’ equal to ‘CUSTOMer’? “ + strLib.equalIgnoreCase(myUni, uniEqual
   end

The output is as follows:

   Is ‘CUSTOMER’ equal to ‘customer’? true 
   Is ‘Customer’ equal to ‘Customer’? true
   Is ‘CUSTOMER’ equal to ‘CUSTOMer’? true