HomeManualTopicsTypesSymbols

std_types::string/std::behind

returns the substring after the specified expression

Parameters

str
the input string
expr
the expression to look for
nth (default: 1)
look for the nth occurrence of *expr* instead for the first one

Results

None

Description

If the specified expression is found within the string the substring after the expression is returned. Otherwise the empty string is returned.

If nth is specified then the nth occurence of the expression expr is looked for. If there are not at least n matches for expr within str then the empty string is returned.

A very similar function is std_types::string/std::truncate_until. It behaves differently only when the expression is not found.

Example

$identifier "std::behind" $name identifier .behind. "::" println! name

Output

behind

Example

$identifier "std::behind" $last_part identifier .behind. '.' println! '[' last_part ']'

Output

[]

Topic

Strings

Implements

std::behind returns the substring behind the specified expression

See also

std_types::string/std::truncate_until returns the substring behind the specified expression
std_types::string/std::before returns the substring before the specified expression
std_types::string/std::between returns the substring between two expressions
std_types::string/std::until returns the substring until (including) the specified expression