Module string

Source
Expand description

const fn equivalents of str methods.

Macros§

str_concat
Macro equivalent of <[&str]>::concat, which takes a constant as an argument.
str_join
Macro equivalent of <[&str]>::join, which takes constants as arguments.

Structs§

Utf8Error
Wrapper around core::str::Utf8Error to provide a panic method for use in unwrap_ctx, returned by from_utf8.

Traits§

Pattern
A string pattern.

Functions§

__from_u8_subslice_of_str
Checks that the start and end are valid utf8 char boundaries when the "debug" feature is enabled.
cmp_str
A const equivalent of str::cmp.
contains
A const equivalent of str::contains , taking a Pattern parameter.
ends_with
A const equivalent of str::ends_with , taking a Pattern parameter.
eq_str
A const equivalent of &str equality comparison.
find
A const equivalent of str::find , taking a Pattern parameter.
find_keep
Advances this up to the first instance of needle.
find_skip
Advances this past the first instance of needle.
from_utf8
Delegates to core::str::from_utf8, wrapping the error to provide a panic method for use in unwrap_ctx
get_from
A const equivalent of string.get(from..).
get_range
A const equivalent of string.get(start..end).
get_up_to
A const equivalent of string.get(..len).
is_char_boundary
Const equivalent of str::is_char_boundary.
rcontains
A const equivalent of str::contains , taking a Pattern parameter.
rfind
A const equivalent of str::rfind , taking a Pattern parameter.
rfind_keep
Truncates this to the last instance of needle.
rfind_skip
Truncates this to before the last instance of needle.
rsplit_once
A const-equivalent of the str::rsplit_once method.
split_at
A const equivalent of str::split_at
split_once
A const-equivalent of the str::split_once method.
starts_with
A const equivalent of str::starts_with , taking a Pattern parameter.
str_from
A const equivalent of &string[start..].
str_range
A const equivalent of &string[start..end].
str_up_to
A const equivalent of &string[..len].
strip_prefix
A const subset of str::strip_prefix.
strip_suffix
A const subset of str::strip_suffix.
trim
A const subset of str::trim which only removes ascii whitespace.
trim_end
A const subset of str::trim_end which only removes ascii whitespace.
trim_end_matches
A const subset of str::trim_end_matches.
trim_matches
A const subset of str::trim_matches.
trim_start
A const subset of str::trim_start which only removes ascii whitespace.
trim_start_matches
A const subset of str::trim_start_matches.