HomeManualTopicsTypesSymbols

std_types::string/std::without_suffix

returns the string without the specified suffix

Parameters

self
suffix

Results

None

Description

Checks whether the string has the specified suffix and if so returns the string without it. Otherwise the string is returned unaltered.

Example

$path "/home/user" $base_dir path .without_suffix. "/user" println! base_dir

Output

/home

Topic

Strings

Implements

std::without_suffix removes a specific expression at the end of a string

See also

std_types::string/std::without_prefix returns the string without the specified prefix
std_types::string/std::has_suffix checks whether the string has the specified suffix