Skip to content

Checks whether two strings are equal.

equals(x:string, y:string, [ignore_case=bool]) -> bool

The equals function returns true if x and y are equal and false otherwise.

Set ignore_case=true to compare using full Unicode case folding instead of case-sensitive matching.

The left-hand string to compare.

The right-hand string to compare.

If true, compares strings using full Unicode case folding.

Defaults to false.

from {
same: equals("abc", "abc"),
different: equals("abc", "ABC"),
}
{
same: true,
different: false,
}
from {
ascii: equals("Get", "GET", ignore_case=true),
unicode: equals("STRASSE", "straße", ignore_case=true),
}
{
ascii: true,
unicode: true,
}

Last updated: