HomeManualTopicsTypesSymbols

std_types::string/std::without_prefix

returns the string without the specified prefix

Parameters

self
prefix

Results

None

Description

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

Example

$path "/home/user" $user_name path .without_prefix. "/home/" println! user_name

Output

user

Topic

Strings

Implements

std::without_prefix removes a specific expression at the start of a string

See also

std_types::string/std::without_suffix returns the string without the specified suffix
std_types::string/std::has_prefix checks whether the string has the specified prefix