Module string

Source
Expand description

const fn equivalents of str methods.

Re-exports§

pub use deprecated_reexports::*;Deprecated

Modules§

deprecated_reexportsDeprecated
Reexports for 0.2.* patch releases, will be removed in 0.3.0

Macros§

from_utf8
A const equivalent of std::str::from_utf8, usable *only in consts and statics.

Structs§

RSplit
Const equivalent of core::str::RSplit<'a, &'b str>
RSplitTerminator
Const equivalent of core::str::RSplitTerminator<'a, &'b str>
Split
Const equivalent of core::str::Split<'a, &'b str>
SplitTerminator
Const equivalent of core::str::SplitTerminator<'a, &'b str>
Utf8Error
Error returned by the from_utf8 function and macro when the input byte slice isn’t valid utf8.

Functions§

cmp_str
A const equivalent of str::cmp.
contains
A const equivalent of str::contains , taking a &str parameter, searching in &left[from..].
ends_with
A const equivalent of str::ends_with , taking a &str parameter.
eq_str
A const equivalent of &str equality comparison.
find
A const equivalent of str::find , taking a &str parameter, searching in &left[from..].
find_keep
Advances this up to the first instance of needle.
find_skip
Advances this past the first instance of needle.
from_utf8
A const equivalent of std::str::from_utf8, requires Rust 1.55 and the "rust_1_55" feature.
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).
rcontains
A const equivalent of str::contains , taking a &str parameter, searching in &left[..=from] from the end.
rfind
A const equivalent of str::rfind , taking a &str parameter, searching in &left[..=from].
rfind_keep
Truncates this to the last instance of needle.
rfind_skip
Truncates this to before the last instance of needle.
rsplit
Const equivalent of str::rsplit, which only takes a &str delimiter.
rsplit_once
A const-equivalent of the str::rsplit_once method.
rsplit_terminator
Const equivalent of str::rsplit_terminator, which only takes a &str delimiter.
split
Const equivalent of str::split, which only takes a &str delimiter.
split_at
A const equivalent of str::split_at
split_once
A const-equivalent of the str::split_once method.
split_terminator
Const equivalent of str::split_terminator, which only takes a &str delimiter.
starts_with
A const equivalent of str::starts_with , taking a &str 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, this only takes a &str pattern.
strip_suffix
A const subset of str::strip_suffix, this only takes a &str pattern.
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 which only takes a &str pattern.
trim_matches
A const subset of str::trim_matches which only takes a &str pattern.
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 which only takes a &str pattern.