HomeManualTopicsTypesSymbols

std_types::string/std::has_suffix

checks whether the string has the specified suffix

Parameters

self
suffix
the suffix to check for

Results

None

Example

$path "/home/user/" if path .has_suffix. '/': println! "path ends with a slash" : println! "path does not end with a slash"

Topic

Strings

Implements

std::has_suffix returns *true* if the second argument is a suffix of the first argument

See also

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