COMPARE_STRING Function


Description: Compare the Source text with the Compare text; this is a lexicographic comparison between strings. The result is a negative integer if the source string lexicographically precedes the compare string. The result is a positive integer if the source string lexicographically follows the compare string. The result is zero if the strings are equal.

Parameters: String, String, Boolean

  • Source: The source string to be compared.
  • Compare: The string to compare against the Source string.
  • Case sensitive: Ignore uppercase and lowercase differences (true or false).

Return: Integer

Syntax: COMPARE_STRING(<source text>,<compare text>,<ignore case differences>)

Example: With three string fields, set the value in String 3 based on the values in String 1 and String 2. If they are the same, set String 3 to the value in String 1. If they are different, combine both String 1 and String 2 into String 3. Ignore differences in case.

if
(( COMPARE_STRING( DE("String 1").getValue( ), DE("String 2").getValue( ), true ) ) == 0 ) then
{
DE("String 3").setValue( DE("String 1").getValue( ) );
}
else
{
DE("String 3").setValue( DE("String 1").getValue( ) + " " + DE("String 2").getValue( ) );
}

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*