STRING::HAS_PREFIX 1g 2024-12-10 laplante@plcb.ca GOWEB/STRING — Check String Prefix


title: “STRING::HAS_PREFIX” version: “1.0.0” date: 2024-12-10 author: “laplante@plcb.ca” section: “1g” category: “GOWEB/STRING”


Name

string::has_prefix Check String Prefix

Synopsis

string::has_prefix(string, prefix[, error: variable])
has_prefix(string, prefix[, error: variable])
string::hasPrefix(string, prefix[, error: variable])
hasPrefix(string, prefix[, error: variable])

Description

The has_prefix function returns a boolean value indicating whether the given string starts with the specified prefix.


Examples

res={{
    dir := "/extengo/file";
    has_prefix(dir, "/extengo");
    has_prefix(dir, "extengo");
    has_suffix(dir, "le");
    has_suffix(dir, "le.");
    has_suffix(dir, "");
}}.

Returns:

res=truefalsetruefalsetrue

Author

laplante@plcb.ca

See Also


Version