HomeManualTopicsTypesSymbols

std_types::string/std::has_prefix

checks whether the string has the specified prefix

Parameters

self
prefix
the prefix to check for

Results

None

Example

$path "/home/user/" if path .has_prefix. "/home/": println! "path starts with /home/" : println! "path does not start with /home/"

Topic

Strings

Implements

std::has_prefix returns *true* if the second argument is a prefix of the first argument

See also

std_types::string/std::has_suffix checks whether the string has the specified suffix
std_types::string/std::without_prefix returns the string without the specified prefix
std_types::string/std::contains succeeds if the specified expression occurrs at least once within the string