UCE Docs / str_starts_with

Signature

bool str_starts_with(String haystack, String needle)

Parameters

haystack : string to inspect
needle : prefix to compare against the start of haystack
return value : true when haystack begins with needle, otherwise false

Checks whether haystack starts with needle.

Example

print(str_starts_with("/doc", "/") ? "yes\n" : "no\n");
Output
yes