doc.rust-lang.org
pub fn trim_left_matches<P>(&self, pat: P) -> &str
Returns a string slice with all prefixes that match a pattern repeatedly removed.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn trim_left(&self) -> &str
Returns a string slice with leading whitespace removed.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn trim_end_matches<P>(&self, pat: P) -> &str
Returns a string slice with all suffixes that match a pattern repeatedly removed.
method
core
Stable since 1.30.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn trim_end(&self) -> &str
Returns a string slice with trailing whitespace removed.
method
core
Stable since 1.30.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn trim_ascii_start(&self) -> &str
Returns a string slice with leading ASCII whitespace removed.
method
core
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn trim_ascii_end(&self) -> &str
Returns a string slice with trailing ASCII whitespace removed.
method
core
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn trim_ascii(&self) -> &str
Returns a string slice with leading and trailing ASCII whitespace removed.
method
core
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn trim(&self) -> &str
Returns a string slice with leading and trailing whitespace removed.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
fn from_str(s: &str) -> Result<Self, <Self as >::Err>
Parses a string s to return a value of this type.
associated_function
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
type Err
The associated error which can be returned from parsing.
associated_type
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub trait FromStr
Parse a value from a string
trait
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn substr_range(&self, substr: &str) -> Option<Range<usize>>
Returns the range that a substring points to.
method
core
Stable since 1.98.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn strip_suffix<P>(&self, suffix: P) -> Option<&str>
Returns a string slice with the suffix removed.
method
core
Stable since 1.45.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn strip_prefix<P>(&self, prefix: P) -> Option<&str>
Returns a string slice with the prefix removed.
method
core
Stable since 1.45.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn strip_circumfix<P, S>(&self, prefix: P, suffix: S) -> Option<&str>
Returns a string slice with the prefix and suffix removed.
method
core
Stable since 1.98.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn starts_with<P>(&self, pat: P) -> bool
Returns true if the given pattern matches a prefix of this string slice.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn splitn<P>(&self, n: usize, pat: P) -> SplitN<'_, P>
Returns an iterator over substrings of the given string slice, separated by a pattern, restricted to returning at most n items.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn split_whitespace(&self) -> SplitWhitespace<'_>
Splits a string slice by whitespace.
method
core
Stable since 1.1.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn split_terminator<P>(&self, pat: P) -> SplitTerminator<'_, P>
Returns an iterator over substrings of the given string slice, separated by characters matched by a pattern.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn split_once<P>(&self, delimiter: P) -> Option<(&str, &str)>
Splits the string on the first occurrence of the specified delimiter and returns prefix before delimiter and suffix after delimiter.
method
core
Stable since 1.52.0
Version 1.100.0-nightly