Skip to content

Checks whether a string starts with a specified substring.

starts_with(x:string, prefix:string, [ignore_case=bool]) -> bool

The starts_with function returns true if x starts with prefix and false otherwise.

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

from {x: "hello".starts_with("he")}
{x: true}
from {
ascii: "Get".starts_with("get", ignore_case=true),
unicode: "STRASSE".starts_with("straße", ignore_case=true),
}
{
ascii: true,
unicode: true,
}

Last updated: