Expand description
String manipulation.
For more details, see the std::str
module.
Modules
- converts 🔒Ways to create a
str
from bytes slice. - count 🔒Code for efficiently counting the number of
char
s in a UTF-8 encoded string. - error 🔒Defines utf8 error type.
- iter 🔒Iterators for
str
methods. - lossy 🔒
- patternExperimentalThe string Pattern API.
- traits 🔒Trait implementations for
str
. - Operations related to UTF-8 validation.
Structs
- Utf8ChunkExperimentalAn item returned by the
Utf8Chunks
iterator. - Utf8ChunksExperimental
- An iterator over the bytes of a string slice.
- An iterator over the
char
s of a string slice, and their positions. - An iterator over the
char
s of a string slice. - An iterator of
u16
over the string encoded as UTF-16. - The return type of
str::escape_debug
. - The return type of
str::escape_default
. - The return type of
str::escape_unicode
. - An iterator over the lines of a string, as string slices.
- LinesAnyDeprecatedCreated with the method
lines_any
. - LinesMap 🔒A nameable, cloneable fn type
- Created with the method
match_indices
. - Created with the method
matches
. - An error returned when parsing a
bool
usingfrom_str
fails - Created with the method
rmatch_indices
. - Created with the method
rmatches
. - Created with the method
rsplit
. - Created with the method
rsplitn
. - Created with the method
rsplit_terminator
. - Created with the method
split
. - An iterator over the non-ASCII-whitespace substrings of a string, separated by any amount of ASCII whitespace.
- An iterator over the substrings of a string, terminated by a substring matching to a predicate function Unlike
Split
, it contains the matched part as a terminator of the subslice. - Created with the method
splitn
. - Created with the method
split_terminator
. - An iterator over the non-whitespace substrings of a string, separated by any amount of whitespace.
- Errors which can occur when attempting to interpret a sequence of
u8
as a string.
Traits
- Parse a value from a string
Functions
- next_code_point⚠ExperimentalReads the next code point out of a byte iterator (assuming a UTF-8-like encoding).
- utf8_char_widthExperimentalGiven a first byte, determines how many bytes are in this UTF-8 character.
- Converts a slice of bytes to a string slice.
- Converts a mutable slice of bytes to a mutable string slice.
- Converts a slice of bytes to a string slice without checking that the string contains valid UTF-8.
- Converts a slice of bytes to a string slice without checking that the string contains valid UTF-8; mutable version.