# String Comparer


# Description

StringComparer refers to a set of case sensitive, culture-based or ordinal-based rules to determine if two strings can be considered equal.

The StringComparer value is set as an attribute called ValueComparer in the <Keyword> tag. This defines how keywords entered by the user are compared to facet names in the 1search implementation.

# Syntax

<Keyword Name="string" Func="string" ValueComparer="string">

# String Comparer Values

  • "Ordinal" (default) :
    • Performs an ordinal, case sensitive string comparison. In an ordinal comparison, the unicode value of each character in the string is compared.
  • "OrdinalIgnoreCase" :
    • Performs an ordinal, case insensitive string comparison.
  • "CurrentCulture" :
    • Performs a case sensitive string comparer based on the current culture configured. See Culture Info Options for more information about Culture.
  • "CurrentCultureIgnoreCase" :
    • Performs a case insensitive string comparer based on the current culture configured.
  • "InvariantCulture" :
    • Performs a case sensitive string comparer based on the invariant culture configured.
  • "InvariantCultureIgnoreCase" :
    • Performs a case insensitive string comparer based on the invariant culture configured.
  • "Integer" :
    • Parses the string inputs into integers and then compares the two integer values.
    • If neither of the values can be parsed into an integer, the "CurrentCulture" option will be used as the String Comparer instead.
  • "SpanishAccentInsensitive" :
    • This case sensitive string comparer drops Spanish accent and uses the current culture configured.
  • "SpanishAccentInsensitiveIgnoreCase" :
    • This case sensitive string comparer drops Spanish accent and uses the current culture configured.