strings.equalFold() function

The strings.equalFold() function reports whether two UTF-8 strings are equal under Unicode case-folding.

*Output data type: Boolean*

  1. import "strings"
  2. strings.equalFold(v: "Go", t: "go")
  3. // returns true

Parameters

v

The string value to compare.

*Data type: String*

t

The string value to compare against.

*Data type: String*

Examples

Ignore case when testing if two strings are the same
  1. import "strings"
  2. data
  3. |> map(fn: (r) => ({
  4. r with
  5. string1: r.string1,
  6. string2: r.string2,
  7. same: strings.equalFold(v: r.string1, t: r.string2)
  8. })
  9. )