HomeManualTopicsTypesSymbols

std_types::string/std::contains

succeeds if the specified expression occurrs at least once within the string

Parameters

self
expr

Results

None

Description

Returns std::true if the specified expression occurs at least once within the string.

Returns std::false if the specified expression does not occur within the string.

Example

$path "/home/user/.bashrc" if path .contains. "/user/": println! "path contains /user/" : println! "path does not contain /user/"

Topic

Strings

Implements

std::contains checks whether a string contains a specific expression

See also

std_types::string/std::has_prefix checks whether the string has the specified prefix
std_types::string/std::has_suffix checks whether the string has the specified suffix