String module

ends_with

procedure · 1 overloadSource

Whether s ends with suffix. An empty suffix always matches.

ends_with :: (s: string, suffix: string) -> bool

Parameters

s: string
suffix: string

Returns

bool
ExampleOpen in playground ↗
assert(ends_with("filename.txt", ".txt"));
assert(!ends_with("txt", "name.txt"));

See also