Skip to content

Checks whether a string ends with a specified substring.

ends_with(x:string, suffix:string, [ignore_case=bool]) -> bool

The ends_with function returns true if x ends with suffix and false otherwise.

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

from {x: "hello".ends_with("lo")}
{x: true}
from {
ascii: "/API/v1/Users".ends_with("USERS", ignore_case=true),
unicode: "Fußstraße".ends_with("STRASSE", ignore_case=true),
}
{
ascii: true,
unicode: true,
}

Last updated: