prefix?

check if string starts with given prefix


Parameters

prefix? string :string
        prefix :char :string :regex

Returns

  • :logical

Examples

copy
prefix? "hello" "he" ; => true prefix? "boom" "he" ; => false

copy
prefix? "hello" {/\w+/} ; => true prefix? "world" {/\d+/} ; => false

copy
prefix? "hello" 'h' ; => true

Related