string prefix? - part-cw/lambdanative GitHub Wiki

(string-prefix? pattern str)

string-prefix? returns true if the str begins with the pattern and false otherwise. This is case sensitive. For a case insensitive version, use string-prefix-ci?.

Parameter Description
pattern The prefix string to look for at the start of str
str Input string

Example

Example 1: Checking if a string begins with a prefix.

> (define mystr "var_x")
> (string-prefix? "var" mystr)
#t