Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 693 Bytes

has-prefix.md

File metadata and controls

25 lines (16 loc) · 693 Bytes

has-prefix?

has-prefix? checks whether a given string begins with another string.

Examples

  • (has-prefix? "hello" "hell")true
  • (has-prefix? "hallo" "halloween")false
  • (has-prefix? "foo" "bar")false

Forms

(has-prefix? base:string prefix:string)bool

  • base is an arbitrary expression.
  • prefix is an arbitrary expression.

has-prefix? evaluates the first argument and coalesces it into a string. If successful, it evalates the prefix the same way. If both values are strings, the function returns true if base begins with prefix.

Context

has-prefix? executes all expressions in their own contexts, so nothing is shared.