Expand description
Utilities for the str primitive type.
Re-exportsยง
use core::borrow::Borrow;๐use core::borrow::BorrowMut;๐use core::iter::FusedIterator;๐use core::mem::MaybeUninit;๐use core::str::pattern::DoubleEndedSearcher;๐Experimental use core::str::pattern::Pattern;๐Experimental use core::str::pattern::ReverseSearcher;๐Experimental use core::str::pattern::Searcher;๐Experimental use core::str::pattern::Utf8Pattern;๐Experimental use core::unicode::conversions;๐Experimental use core::mem;๐use core::ptr;๐use crate::borrow::ToOwned;๐use crate::boxed::Box;๐use crate::slice::Concat;๐Experimental use crate::slice::Join;๐Experimental use crate::slice::SliceIndex;๐use crate::string::String;๐use crate::vec::Vec;๐
Modulesยง
- pattern
Experimental - The string Pattern API.
Macrosยง
- copy_
slice_ ๐and_ advance - specialize_
for_ ๐lengths
Structsยง
- Bytes
- An iterator over the bytes of a string slice.
- Char
Indices - An iterator over the
chars of a string slice, and their positions. - Chars
- An iterator over the
chars of a string slice. - Encode
Utf16 - An iterator of
u16over the string encoded as UTF-16. - Escape
Debug - The return type of
str::escape_debug. - Escape
Default - The return type of
str::escape_default. - Escape
Unicode - The return type of
str::escape_unicode. - Lines
- An iterator over the lines of a string, as string slices.
- Lines
Any Deprecated - Created with the method
lines_any. - Match
Indices - Created with the method
match_indices. - Matches
- Created with the method
matches. - Parse
Bool Error - An error returned when parsing a
boolusingfrom_strfails - RMatch
Indices - Created with the method
rmatch_indices. - RMatches
- Created with the method
rmatches. - RSplit
- Created with the method
rsplit. - RSplitN
- Created with the method
rsplitn. - RSplit
Terminator - Created with the method
rsplit_terminator. - Split
- Created with the method
split. - Split
Ascii Whitespace - An iterator over the non-ASCII-whitespace substrings of a string, separated by any amount of ASCII whitespace.
- Split
Inclusive - 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. - SplitN
- Created with the method
splitn. - Split
Terminator - Created with the method
split_terminator. - Split
Whitespace - An iterator over the non-whitespace substrings of a string, separated by any amount of whitespace.
- Utf8
Chunk - An item returned by the
Utf8Chunksiterator. - Utf8
Chunks - An iterator used to decode a slice of mostly UTF-8 bytes to string slices
(
&str) and byte slices (&[u8]). - Utf8
Error - Errors which can occur when attempting to interpret a sequence of
u8as a string.
Traitsยง
- FromStr
- Parse a value from a string
Functionsยง
- from_
boxed_ โutf8_ unchecked - Converts a boxed slice of bytes to a boxed string slice without checking that the string contains valid UTF-8.
- from_
boxed_ ๐ โutf8_ unchecked_ in - Internal; same as
from_boxed_utf8_uncheckedbut allocator-generic. Name probably not suitable for being madepubas-is. - from_
utf8 - Converts a slice of bytes to a string slice.
- from_
utf8_ mut - Converts a mutable slice of bytes to a mutable string slice.
- from_
utf8_ โunchecked - Converts a slice of bytes to a string slice without checking that the string contains valid UTF-8.
- from_
utf8_ โunchecked_ mut - Converts a slice of bytes to a string slice without checking that the string contains valid UTF-8; mutable version.
- join_
generic_ ๐copy - map_
uppercase_ ๐sigma - Helper for final sigma lowercase
- replace_
ascii ๐ โ - Faster implementation of string replacement for ASCII to ASCII cases. Should produce fast vectorized code.
- convert_
while_ ๐ป โascii Experimental - Converts leading ascii bytes in
sby calling theconvertfunction. - from_
raw_ โparts Experimental - Creates a
&strfrom a pointer and a length. - from_
raw_ โparts_ mut Experimental - Creates a
&mut strfrom a pointer and a length.