<linkrel="alternate icon"type="image/png"href="../../favicon-32x32.png"><styletype="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><bodyclass="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="sidebar"><divclass="sidebar-menu">☰</div><ahref='../../abstio/index.html'><divclass='logo-container rust-logo'><imgsrc='../../rust-logo.png'alt='logo'></div></a><pclass="location">Struct ROOT_DIR</p><divclass="sidebar-elems"><divclass="block items"><aclass="sidebar-title"href="#fields">Fields</a><divclass="sidebar-links"><ahref="#structfield.__private_field">__private_field</a></div><aclass="sidebar-title"href="#deref-methods-String">Methods from Deref<Target=String></a><divclass="sidebar-links"><ahref="#method.as_bytes">as_bytes</a><ahref="#method.as_str">as_str</a><ahref="#method.capacity">capacity</a><ahref="#method.is_empty">is_empty</a><ahref="#method.len">len</a></div><aclass="sidebar-title"href="#deref-methods-str">Methods from Deref<Target=str></a><divclass="sidebar-links"><ahref="#method.as_bytes">as_bytes</a><ahref="#method.as_bytes_mut">as_bytes_mut</a><ahref="#method.as_mut_ptr">as_mut_ptr</a><ahref="#method.as_ptr">as_ptr</a><ahref="#method.bytes">bytes</a><ahref="#method.char_indices">char_indices</a><ahref="#method.chars">chars</a><ahref="#method.contains">contains</a><ahref="#method.encode_utf16">encode_utf16</a><ahref="#method.ends_with">ends_with</a><ahref="#method.eq_ignore_ascii_case">eq_ignore_ascii_case</a><ahref="#method.escape_debug">escape_debug</a><ahref="#method.escape_default">escape_default</a><ahref="#method.escape_unicode">escape_unicode</a><ahref="#method.find">find</a><ahref="#method.get">get</a><ahref="#method.get_mut">get_mut</a><ahref="#method.get_unchecked">get_unchecked</a><ahref="#method.get_unchecked_mut">get_unchecked_mut</a><ahref="#method.is_ascii">is_ascii</a><ahref="#method.is_char_boundary">is_char_boundary</a><ahref="#method.is_empty">is_empty</a><ahref="#method.len">len</a><ahref="#method.lines">lines</a><ahref="#method.lines_any">lines_any</a><ahref="#method.make_ascii_lowercase">make_ascii_lowercase</a><ahref="#method.make_ascii_uppercase">make_ascii_uppercase</a><ahref="#method.match_indices">match_indices</a><ahref="#method.matches">matches</a><ahref="#method.parse">parse</a><ahref="#method.repeat">repeat</a><ahref="#method.replace">replace</a><ahref="#method.replacen">replacen</a><ahref="#method.rfind">rfind</a><ahref="#method.rmatch_indices">rmatch_indices</a><ahref="#method.rmatches">rmatches</a><ahref="#method.rsplit">rsplit</a><ahref="#method.rsplit_once">rsplit_once</a><ahref="#method.rsplit_terminator">rsplit_terminator</a><ahref="#method.rsplitn">rsplitn</a><ahref="#method.slice_mut_unchecked">slice_mut_unchecked</a><ahref="#method.slice_unchecked">slice_unchecked</a><ahref="#method.split">split</a><ahref="#method.split_ascii_whitespace">split_ascii_whitespace</a><ahref="#method.split_at">split_at</a><ahref="#method.split_at_mut">split_at_mut</a><ahref="#method.split_inclusive">split_inclusive</a><ahref="#method.split_once">split_once</a><ahref="#method.split_terminator">split_terminator</a><ahref="#method.split_whitespace">split_whitespace</a><ahref="#method.splitn">splitn</a><ahref="#method.starts_with">starts_with</a><ahref="#method.strip_prefix">strip_prefix</a><ahref="#method.strip_suffix">strip_suffix</a><ahref="#method.to_ascii_lowercase">to_ascii_lowercase</a><ahref="#method.to_ascii_uppercase">to_ascii_uppercase</a><ahref="#method.to_lowercase">to_lowercase</a><ahref="#method.to_uppercase">to_uppercase</a><ahref="#method.trim">trim</a><ahref="#method.trim_end">trim_end</a><ahref="#method.trim_end_matches">trim_end_matches</a><ahref="#method.trim_left">trim_left</a><ahref="#method.trim_left_matches">trim_left_matches</a><ahref="#method.trim_matches">trim_matches</a><ahref="#method.trim_right">trim_right</a><ah
</div><h4id="method.capacity"class="method"><code>pub fn <ahref="#method.capacity"class="fnname">capacity</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#839"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns this <code>String</code>'s capacity, in bytes.</p>
</div><h4id="method.as_bytes"class="method"><code>pub fn <ahref="#method.as_bytes"class="fnname">as_bytes</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#1102"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns a byte slice of this <code>String</code>'s contents.</p>
<p>The inverse of this method is <ahref="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html#method.from_utf8"><code>from_utf8</code></a>.</p>
</div><h4id="method.len"class="method"><code>pub fn <ahref="#method.len"class="fnname">len</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#1395"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns the length of this <code>String</code>, in bytes, not <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"title="char"><code>char</code></a>s or
</div><h4id="method.is_empty"class="method"><code>pub fn <ahref="#method.is_empty"class="fnname">is_empty</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#1414"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns <code>true</code> if this <code>String</code> has a length of zero, and <code>false</code> otherwise.</p>
</div></div><h2id="deref-methods-str"class="small-section-header">Methods from <aclass="trait"href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html"title="trait core::ops::deref::Deref">Deref</a><Target = <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>><ahref="#deref-methods-str"class="anchor"></a></h2><divclass="impl-items"><h4id="method.len-1"class="method"><code>pub const fn <ahref="#method.len-1"class="fnname">len</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><spanclass="since"title="Stable since Rust version 1.0.0, const since 1.32.0">1.0.0 (const: 1.32.0)</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#145"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns the length of <code>self</code>.</p>
<p>This length is in bytes, not <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s or graphemes. In other words,
it may not be what a human considers the length of the string.</p>
</div><h4id="method.is_empty-1"class="method"><code>pub const fn <ahref="#method.is_empty-1"class="fnname">is_empty</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><spanclass="since"title="Stable since Rust version 1.0.0, const since 1.32.0">1.0.0 (const: 1.32.0)</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#165"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns <code>true</code> if <code>self</code> has a length of zero bytes.</p>
</div><h4id="method.is_char_boundary"class="method"><code>pub fn <ahref="#method.is_char_boundary"class="fnname">is_char_boundary</a>(&self, index: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><spanclass="since"title="Stable since Rust version 1.9.0">1.9.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#194"title="goto source code">[src]</a></h4><divclass="docblock"><p>Checks that <code>index</code>-th byte is the first byte in a UTF-8 code point
sequence or the end of the string.</p>
<p>The start and end of the string (when <code>index == self.len()</code>) are
considered to be boundaries.</p>
<p>Returns <code>false</code> if <code>index</code> is greater than <code>self.len()</code>.</p>
</div><h4id="method.as_bytes-1"class="method"><code>pub const fn <ahref="#method.as_bytes-1"class="fnname">as_bytes</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a></code><spanclass="since"title="Stable since Rust version 1.0.0, const since 1.32.0">1.0.0 (const: 1.32.0)</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#224"title="goto source code">[src]</a></h4><divclass="docblock"><p>Converts a string slice to a byte slice. To convert the byte slice back
into a string slice, use the <ahref="https://doc.rust-lang.org/nightly/core/str/converts/fn.from_utf8.html"title="from_utf8"><code>from_utf8</code></a> function.</p>
</div><h4id="method.as_bytes_mut"class="method"><code>pub unsafe fn <ahref="#method.as_bytes_mut"class="fnname">as_bytes_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a></code><spanclass="since"title="Stable since Rust version 1.20.0">1.20.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#267"title="goto source code">[src]</a></h4><divclass="docblock"><p>Converts a mutable string slice to a mutable byte slice.</p>
</div><h4id="method.as_ptr"class="method"><code>pub const fn <ahref="#method.as_ptr"class="fnname">as_ptr</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const </a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code><spanclass="since"title="Stable since Rust version 1.0.0, const since 1.32.0">1.0.0 (const: 1.32.0)</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#297"title="goto source code">[src]</a></h4><divclass="docblock"><p>Converts a string slice to a raw pointer.</p>
<p>As string slices are a slice of bytes, the raw pointer points to a
<ahref="https://doc.rust-lang.org/nightly/std/primitive.u8.html"title="u8"><code>u8</code></a>. This pointer will be pointing to the first byte of the string
slice.</p>
<p>The caller must ensure that the returned pointer is never written to.
If you need to mutate the contents of the string slice, use <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.as_mut_ptr"><code>as_mut_ptr</code></a>.</p>
</div><h4id="method.as_mut_ptr"class="method"><code>pub fn <ahref="#method.as_mut_ptr"class="fnname">as_mut_ptr</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code><spanclass="since"title="Stable since Rust version 1.36.0">1.36.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#311"title="goto source code">[src]</a></h4><divclass="docblock"><p>Converts a mutable string slice to a raw pointer.</p>
<p>As string slices are a slice of bytes, the raw pointer points to a
<ahref="https://doc.rust-lang.org/nightly/std/primitive.u8.html"title="u8"><code>u8</code></a>. This pointer will be pointing to the first byte of the string
slice.</p>
<p>It is your responsibility to make sure that the string slice only gets
modified in a way that it remains valid UTF-8.</p>
</div><h4id="method.get"class="method"><code>pub fn <ahref="#method.get"class="fnname">get</a><I>(&self, i: I) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<I as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html#associatedtype.Output"title="type core::slice::index::SliceIndex::Output">Output</a>><spanclass="where fmt-newline">where<br> I: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>, </span></code><spanclass="since"title="Stable since Rust version 1.20.0">1.20.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#336"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns a subslice of <code>str</code>.</p>
<p>This is the non-panicking alternative to indexing the <code>str</code>. Returns
<ahref="https://doc.rust-lang.org/nightly/core/option/enum.Option.html#variant.None"title="None"><code>None</code></a> whenever equivalent indexing operation would panic.</p>
</div><h4id="method.get_unchecked"class="method"><code>pub unsafe fn <ahref="#method.get_unchecked"class="fnname">get_unchecked</a><I>(&self, i: I) ->&<I as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html#associatedtype.Output"title="type core::slice::index::SliceIndex::Output">Output</a><spanclass="where fmt-newline">where<br> I: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>>, </span></code><spanclass="since"title="Stable since Rust version 1.20.0">1.20.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#400"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns an unchecked subslice of <code>str</code>.</p>
<p>This is the unchecked alternative to indexing the <code>str</code>.</p>
</div><h4id="method.slice_unchecked"class="method"><code>pub unsafe fn <ahref="#method.slice_unchecked"class="fnname">slice_unchecked</a>(&self, begin: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, end: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) ->&<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#487"title="goto source code">[src]</a></h4><divclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span> Deprecated since 1.29.0: <p>use <code>get_unchecked(begin..end)</code> instead</p>
</div></div><divclass="docblock"><p>Creates a string slice from another string slice, bypassing safety
checks.</p>
<p>This is generally not recommended, use with caution! For a safe
alternative see <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html"title="str"><code>str</code></a> and <ahref="https://doc.rust-lang.org/nightly/core/ops/index/trait.Index.html"><code>Index</code></a>.</p>
<p>This new slice goes from <code>begin</code> to <code>end</code>, including <code>begin</code> but
</div><h4id="method.slice_mut_unchecked"class="method"><code>pub unsafe fn <ahref="#method.slice_mut_unchecked"class="fnname">slice_mut_unchecked</a>(<br> &mut self, <br> begin: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, <br> end: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a><br>) ->&mut <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><spanclass="since"title="Stable since Rust version 1.5.0">1.5.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#520"title="goto source code">[src]</a></h4><divclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span> Deprecated since 1.29.0: <p>use <code>get_unchecked_mut(begin..end)</code> instead</p>
</div></div><divclass="docblock"><p>Creates a string slice from another string slice, bypassing safety
checks.
This is generally not recommended, use with caution! For a safe
alternative see <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html"title="str"><code>str</code></a> and <ahref="https://doc.rust-lang.org/nightly/core/ops/index/trait.IndexMut.html"><code>IndexMut</code></a>.</p>
<p>This new slice goes from <code>begin</code> to <code>end</code>, including <code>begin</code> but
excluding <code>end</code>.</p>
<p>To get an immutable string slice instead, see the
<p>Callers of this function are responsible that three preconditions are
satisfied:</p>
<ul>
<li><code>begin</code> must not exceed <code>end</code>.</li>
<li><code>begin</code> and <code>end</code> must be byte positions within the string slice.</li>
<li><code>begin</code> and <code>end</code> must lie on UTF-8 sequence boundaries.</li>
</ul>
</div><h4id="method.split_at"class="method"><code>pub fn <ahref="#method.split_at"class="fnname">split_at</a>(&self, mid: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, &<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><spanclass="since"title="Stable since Rust version 1.4.0">1.4.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#559"title="goto source code">[src]</a></h4><divclass="docblock"><p>Divide one string slice into two at an index.</p>
<p>The argument, <code>mid</code>, should be a byte offset from the start of the
string. It must also be on the boundary of a UTF-8 code point.</p>
<p>The two slices returned go from the start of the string slice to <code>mid</code>,
and from <code>mid</code> to the end of the string slice.</p>
<p>To get mutable string slices instead, see the <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_at_mut"><code>split_at_mut</code></a>
</div><h4id="method.split_at_mut"class="method"><code>pub fn <ahref="#method.split_at_mut"class="fnname">split_at_mut</a>(&mut self, mid: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&mut <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, &mut <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code><spanclass="since"title="Stable since Rust version 1.4.0">1.4.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#602"title="goto source code">[src]</a></h4><divclass="docblock"><p>Divide one mutable string slice into two at an index.</p>
<p>The argument, <code>mid</code>, should be a byte offset from the start of the
string. It must also be on the boundary of a UTF-8 code point.</p>
<p>The two slices returned go from the start of the string slice to <code>mid</code>,
and from <code>mid</code> to the end of the string slice.</p>
<p>To get immutable string slices instead, see the <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_at"><code>split_at</code></a> method.</p>
</div><h4id="method.chars"class="method"><code>pub fn <ahref="#method.chars"class="fnname">chars</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.Chars.html"title="struct core::str::iter::Chars">Chars</a><'_></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#668"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns an iterator over the <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s of a string slice.</p>
<p>As a string slice consists of valid UTF-8, we can iterate through a
string slice by <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>. This method returns such an iterator.</p>
<p>It's important to remember that <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a> represents a Unicode Scalar
Value, and may not match your idea of what a 'character' is. Iteration
over grapheme clusters may be what you actually want. This functionality
is not provided by Rust's standard library, check crates.io instead.</p>
<p>Remember, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s may not match your intuition about characters:</p>
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="prelude-val">Some</span>(<spanclass="string">'y'</span>), <spanclass="ident">chars</span>.<spanclass="ident">next</span>()); <spanclass="comment">// not 'y̆'</span>
</div><h4id="method.char_indices"class="method"><code>pub fn <ahref="#method.char_indices"class="fnname">char_indices</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.CharIndices.html"title="struct core::str::iter::CharIndices">CharIndices</a><'_></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#725"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns an iterator over the <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s of a string slice, and their
positions.</p>
<p>As a string slice consists of valid UTF-8, we can iterate through a
string slice by <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>. This method returns an iterator of both
these <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, as well as their byte positions.</p>
<p>The iterator yields tuples. The position is first, the <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a> is
<p>Remember, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s may not match your intuition about characters:</p>
</div><h4id="method.bytes"class="method"><code>pub fn <ahref="#method.bytes"class="fnname">bytes</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.Bytes.html"title="struct core::str::iter::Bytes">Bytes</a><'_></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#750"title="goto source code">[src]</a></h4><divclass="docblock"><p>An iterator over the bytes of a string slice.</p>
<p>As a string slice consists of a sequence of bytes, we can iterate
through a string slice by byte. This method returns such an iterator.</p>
</div><h4id="method.split_whitespace"class="method"><code>pub fn <ahref="#method.split_whitespace"class="fnname">split_whitespace</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.SplitWhitespace.html"title="struct core::str::iter::SplitWhitespace">SplitWhitespace</a><'_></code><spanclass="since"title="Stable since Rust version 1.1.0">1.1.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#793"title="goto source code">[src]</a></h4><divclass="docblock"><p>Splits a string slice by whitespace.</p>
<p>The iterator returned will return string slices that are sub-slices of
the original string slice, separated by any amount of whitespace.</p>
<p>'Whitespace' is defined according to the terms of the Unicode Derived
Core Property <code>White_Space</code>. If you only want to split on ASCII whitespace
instead, use <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_ascii_whitespace"><code>split_ascii_whitespace</code></a>.</p>
<spanclass="kw">let</span><spanclass="kw-2">mut</span><spanclass="ident">iter</span><spanclass="op">=</span><spanclass="string">"A few words"</span>.<spanclass="ident">split_whitespace</span>();
<spanclass="kw">let</span><spanclass="kw-2">mut</span><spanclass="ident">iter</span><spanclass="op">=</span><spanclass="string">" Mary had\ta\u{2009}little \n\t lamb"</span>.<spanclass="ident">split_whitespace</span>();
</div><h4id="method.split_ascii_whitespace"class="method"><code>pub fn <ahref="#method.split_ascii_whitespace"class="fnname">split_ascii_whitespace</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.SplitAsciiWhitespace.html"title="struct core::str::iter::SplitAsciiWhitespace">SplitAsciiWhitespace</a><'_></code><spanclass="since"title="Stable since Rust version 1.34.0">1.34.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#834"title="goto source code">[src]</a></h4><divclass="docblock"><p>Splits a string slice by ASCII whitespace.</p>
<p>The iterator returned will return string slices that are sub-slices of
the original string slice, separated by any amount of ASCII whitespace.</p>
<p>To split by Unicode <code>Whitespace</code> instead, use <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_whitespace"><code>split_whitespace</code></a>.</p>
<spanclass="kw">let</span><spanclass="kw-2">mut</span><spanclass="ident">iter</span><spanclass="op">=</span><spanclass="string">"A few words"</span>.<spanclass="ident">split_ascii_whitespace</span>();
<spanclass="kw">let</span><spanclass="kw-2">mut</span><spanclass="ident">iter</span><spanclass="op">=</span><spanclass="string">" Mary had\ta little \n\t lamb"</span>.<spanclass="ident">split_ascii_whitespace</span>();
</div><h4id="method.lines"class="method"><code>pub fn <ahref="#method.lines"class="fnname">lines</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.Lines.html"title="struct core::str::iter::Lines">Lines</a><'_></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#880"title="goto source code">[src]</a></h4><divclass="docblock"><p>An iterator over the lines of a string, as string slices.</p>
<p>Lines are ended with either a newline (<code>\n</code>) or a carriage return with
a line feed (<code>\r\n</code>).</p>
<p>The final line ending is optional. A string that ends with a final line
ending will return the same lines as an otherwise identical string
</div><h4id="method.lines_any"class="method"><code>pub fn <ahref="#method.lines_any"class="fnname">lines_any</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.LinesAny.html"title="struct core::str::iter::LinesAny">LinesAny</a><'_></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#889"title="goto source code">[src]</a></h4><divclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span> Deprecated since 1.4.0: <p>use lines() instead now</p>
</div></div><divclass="docblock"><p>An iterator over the lines of a string.</p>
</div><h4id="method.encode_utf16"class="method"><code>pub fn <ahref="#method.encode_utf16"class="fnname">encode_utf16</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.EncodeUtf16.html"title="struct core::str::iter::EncodeUtf16">EncodeUtf16</a><'_></code><spanclass="since"title="Stable since Rust version 1.8.0">1.8.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#908"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns an iterator of <code>u16</code> over the string encoded as UTF-16.</p>
</div><h4id="method.contains"class="method"><code>pub fn <ahref="#method.contains"class="fnname">contains</a><'a, P>(&'a self, pat: P) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#935"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns <code>true</code> if the given pattern matches a sub-slice of
this string slice.</p>
<p>Returns <code>false</code> if it does not.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div><h4id="method.starts_with"class="method"><code>pub fn <ahref="#method.starts_with"class="fnname">starts_with</a><'a, P>(&'a self, pat: P) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#961"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns <code>true</code> if the given pattern matches a prefix of this
string slice.</p>
<p>Returns <code>false</code> if it does not.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div><h4id="method.ends_with"class="method"><code>pub fn <ahref="#method.ends_with"class="fnname">ends_with</a><'a, P>(&'a self, pat: P) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,<br> <P as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#987-989"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns <code>true</code> if the given pattern matches a suffix of this
string slice.</p>
<p>Returns <code>false</code> if it does not.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div><h4id="method.find"class="method"><code>pub fn <ahref="#method.find"class="fnname">find</a><'a, P>(&'a self, pat: P) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1038"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns the byte index of the first character of this string slice that
matches the pattern.</p>
<p>Returns <ahref="https://doc.rust-lang.org/nightly/core/option/enum.Option.html#variant.None"title="None"><code>None</code></a> if the pattern doesn't match.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div><h4id="method.rfind"class="method"><code>pub fn <ahref="#method.rfind"class="fnname">rfind</a><'a, P>(&'a self, pat: P) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,<br> <P as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1084-1086"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns the byte index for the first character of the rightmost match of the pattern in
this string slice.</p>
<p>Returns <ahref="https://doc.rust-lang.org/nightly/core/option/enum.Option.html#variant.None"title="None"><code>None</code></a> if the pattern doesn't match.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div><h4id="method.split"class="method"><code>pub fn <ahref="#method.split"class="fnname">split</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.Split.html"title="struct core::str::iter::Split">Split</a><'a, P><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1206"title="goto source code">[src]</a></h4><divclass="docblock"><p>An iterator over substrings of this string slice, separated by
characters matched by a pattern.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator will be a <ahref="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if the pattern
allows a reverse search and forward/reverse search yields the same
elements. This is true for, e.g., <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, but not for <code>&str</code>.</p>
<p>If the pattern allows a reverse search but its results might differ
from a forward search, the <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.rsplit"><code>rsplit</code></a> method can be used.</p>
<spanclass="kw">let</span><spanclass="ident">v</span>: <spanclass="ident">Vec</span><spanclass="op"><</span><spanclass="kw-2">&</span><spanclass="ident">str</span><spanclass="op">></span><spanclass="op">=</span><spanclass="string">"Mary had a little lamb"</span>.<spanclass="ident">split</span>(<spanclass="string">''</span>).<spanclass="ident">collect</span>();
<spanclass="kw">let</span><spanclass="ident">x</span><spanclass="op">=</span><spanclass="string">" a b c"</span>.<spanclass="ident">to_string</span>();
<p>Use <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_whitespace"><code>split_whitespace</code></a> for this behavior.</p>
</div><h4id="method.split_inclusive"class="method"><code>pub fn <ahref="#method.split_inclusive"class="fnname">split_inclusive</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.SplitInclusive.html"title="struct core::str::iter::SplitInclusive">SplitInclusive</a><'a, P><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.51.0">1.51.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1246"title="goto source code">[src]</a></h4><divclass="docblock"><p>An iterator over substrings of this string slice, separated by
characters matched by a pattern. Differs from the iterator produced by
<code>split</code> in that <code>split_inclusive</code> leaves the matched part as the
terminator of the substring.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<spanclass="kw">let</span><spanclass="ident">v</span>: <spanclass="ident">Vec</span><spanclass="op"><</span><spanclass="kw-2">&</span><spanclass="ident">str</span><spanclass="op">></span><spanclass="op">=</span><spanclass="string">"Mary had a little lamb\nlittle lamb\nlittle lamb."</span>
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="ident">v</span>, [<spanclass="string">"Mary had a little lamb\n"</span>, <spanclass="string">"little lamb\n"</span>, <spanclass="string">"little lamb."</span>]);</pre></div>
<p>If the last element of the string is matched,
that element will be considered the terminator of the preceding substring.
That substring will be the last item returned by the iterator.</p>
<spanclass="kw">let</span><spanclass="ident">v</span>: <spanclass="ident">Vec</span><spanclass="op"><</span><spanclass="kw-2">&</span><spanclass="ident">str</span><spanclass="op">></span><spanclass="op">=</span><spanclass="string">"Mary had a little lamb\nlittle lamb\nlittle lamb.\n"</span>
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="ident">v</span>, [<spanclass="string">"Mary had a little lamb\n"</span>, <spanclass="string">"little lamb\n"</span>, <spanclass="string">"little lamb.\n"</span>]);</pre></div>
</div><h4id="method.rsplit"class="method"><code>pub fn <ahref="#method.rsplit"class="fnname">rsplit</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.RSplit.html"title="struct core::str::iter::RSplit">RSplit</a><'a, P><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,<br> <P as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1301-1303"title="goto source code">[src]</a></h4><divclass="docblock"><p>An iterator over substrings of the given string slice, separated by
characters matched by a pattern and yielded in reverse order.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator requires that the pattern supports a reverse
search, and it will be a <ahref="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if a forward/reverse
search yields the same elements.</p>
<p>For iterating from the front, the <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split"><code>split</code></a> method can be used.</p>
<spanclass="kw">let</span><spanclass="ident">v</span>: <spanclass="ident">Vec</span><spanclass="op"><</span><spanclass="kw-2">&</span><spanclass="ident">str</span><spanclass="op">></span><spanclass="op">=</span><spanclass="string">"Mary had a little lamb"</span>.<spanclass="ident">rsplit</span>(<spanclass="string">''</span>).<spanclass="ident">collect</span>();
</div><h4id="method.split_terminator"class="method"><code>pub fn <ahref="#method.split_terminator"class="fnname">split_terminator</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.SplitTerminator.html"title="struct core::str::iter::SplitTerminator">SplitTerminator</a><'a, P><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1349"title="goto source code">[src]</a></h4><divclass="docblock"><p>An iterator over substrings of the given string slice, separated by
characters matched by a pattern.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>Equivalent to <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split"><code>split</code></a>, except that the trailing substring
is skipped if empty.</p>
<p>This method can be used for string data that is <em>terminated</em>,
<p>The returned iterator will be a <ahref="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if the pattern
allows a reverse search and forward/reverse search yields the same
elements. This is true for, e.g., <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, but not for <code>&str</code>.</p>
<p>If the pattern allows a reverse search but its results might differ
from a forward search, the <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.rsplit_terminator"><code>rsplit_terminator</code></a> method can be used.</p>
</div><h4id="method.rsplit_terminator"class="method"><code>pub fn <ahref="#method.rsplit_terminator"class="fnname">rsplit_terminator</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.RSplitTerminator.html"title="struct core::str::iter::RSplitTerminator">RSplitTerminator</a><'a, P><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,<br> <P as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1392-1394"title="goto source code">[src]</a></h4><divclass="docblock"><p>An iterator over substrings of <code>self</code>, separated by characters
matched by a pattern and yielded in reverse order.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>Equivalent to <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split"><code>split</code></a>, except that the trailing substring is
skipped if empty.</p>
<p>This method can be used for string data that is <em>terminated</em>,
<p>The returned iterator requires that the pattern supports a
reverse search, and it will be double ended if a forward/reverse
search yields the same elements.</p>
<p>For iterating from the front, the <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_terminator"><code>split_terminator</code></a> method can be
</div><h4id="method.splitn"class="method"><code>pub fn <ahref="#method.splitn"class="fnname">splitn</a><'a, P>(&'a self, n: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.SplitN.html"title="struct core::str::iter::SplitN">SplitN</a><'a, P><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1447"title="goto source code">[src]</a></h4><divclass="docblock"><p>An iterator over substrings of the given string slice, separated by a
pattern, restricted to returning at most <code>n</code> items.</p>
<p>If <code>n</code> substrings are returned, the last substring (the <code>n</code>th substring)
will contain the remainder of the string.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator will not be double ended, because it is
not efficient to support.</p>
<p>If the pattern allows a reverse search, the <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.rsplitn"><code>rsplitn</code></a> method can be
<spanclass="kw">let</span><spanclass="ident">v</span>: <spanclass="ident">Vec</span><spanclass="op"><</span><spanclass="kw-2">&</span><spanclass="ident">str</span><spanclass="op">></span><spanclass="op">=</span><spanclass="string">"Mary had a little lambda"</span>.<spanclass="ident">splitn</span>(<spanclass="number">3</span>, <spanclass="string">''</span>).<spanclass="ident">collect</span>();
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="ident">v</span>, [<spanclass="string">"Mary"</span>, <spanclass="string">"had"</span>, <spanclass="string">"a little lambda"</span>]);
</div><h4id="method.rsplitn"class="method"><code>pub fn <ahref="#method.rsplitn"class="fnname">rsplitn</a><'a, P>(&'a self, n: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.RSplitN.html"title="struct core::str::iter::RSplitN">RSplitN</a><'a, P><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,<br> <P as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1496-1498"title="goto source code">[src]</a></h4><divclass="docblock"><p>An iterator over substrings of this string slice, separated by a
pattern, starting from the end of the string, restricted to returning
at most <code>n</code> items.</p>
<p>If <code>n</code> substrings are returned, the last substring (the <code>n</code>th substring)
will contain the remainder of the string.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator will not be double ended, because it is not
efficient to support.</p>
<p>For splitting from the front, the <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.splitn"><code>splitn</code></a> method can be used.</p>
<spanclass="kw">let</span><spanclass="ident">v</span>: <spanclass="ident">Vec</span><spanclass="op"><</span><spanclass="kw-2">&</span><spanclass="ident">str</span><spanclass="op">></span><spanclass="op">=</span><spanclass="string">"Mary had a little lamb"</span>.<spanclass="ident">rsplitn</span>(<spanclass="number">3</span>, <spanclass="string">''</span>).<spanclass="ident">collect</span>();
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="ident">v</span>, [<spanclass="string">"lamb"</span>, <spanclass="string">"little"</span>, <spanclass="string">"Mary had a"</span>]);
</div><h4id="method.matches"class="method"><code>pub fn <ahref="#method.matches"class="fnname">matches</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.Matches.html"title="struct core::str::iter::Matches">Matches</a><'a, P><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.2.0">1.2.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1577"title="goto source code">[src]</a></h4><divclass="docblock"><p>An iterator over the disjoint matches of a pattern within the given string
slice.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator will be a <ahref="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if the pattern
allows a reverse search and forward/reverse search yields the same
elements. This is true for, e.g., <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, but not for <code>&str</code>.</p>
<p>If the pattern allows a reverse search but its results might differ
from a forward search, the <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.matches"><code>rmatches</code></a> method can be used.</p>
</div><h4id="method.rmatches"class="method"><code>pub fn <ahref="#method.rmatches"class="fnname">rmatches</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.RMatches.html"title="struct core::str::iter::RMatches">RMatches</a><'a, P><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,<br> <P as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.2.0">1.2.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1613-1615"title="goto source code">[src]</a></h4><divclass="docblock"><p>An iterator over the disjoint matches of a pattern within this string slice,
yielded in reverse order.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator requires that the pattern supports a reverse
search, and it will be a <ahref="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if a forward/reverse
search yields the same elements.</p>
<p>For iterating from the front, the <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.matches"><code>matches</code></a> method can be used.</p>
</div><h4id="method.match_indices"class="method"><code>pub fn <ahref="#method.match_indices"class="fnname">match_indices</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.MatchIndices.html"title="struct core::str::iter::MatchIndices">MatchIndices</a><'a, P><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.5.0">1.5.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1659"title="goto source code">[src]</a></h4><divclass="docblock"><p>An iterator over the disjoint matches of a pattern within this string
slice as well as the index that the match starts at.</p>
<p>For matches of <code>pat</code> within <code>self</code> that overlap, only the indices
corresponding to the first match are returned.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator will be a <ahref="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if the pattern
allows a reverse search and forward/reverse search yields the same
elements. This is true for, e.g., <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, but not for <code>&str</code>.</p>
<p>If the pattern allows a reverse search but its results might differ
from a forward search, the <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.match_indices"><code>rmatch_indices</code></a> method can be used.</p>
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="ident">v</span>, [(<spanclass="number">0</span>, <spanclass="string">"aba"</span>)]); <spanclass="comment">// only the first `aba`</span></pre></div>
</div><h4id="method.rmatch_indices"class="method"><code>pub fn <ahref="#method.rmatch_indices"class="fnname">rmatch_indices</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.RMatchIndices.html"title="struct core::str::iter::RMatchIndices">RMatchIndices</a><'a, P><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,<br> <P as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.5.0">1.5.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1701-1703"title="goto source code">[src]</a></h4><divclass="docblock"><p>An iterator over the disjoint matches of a pattern within <code>self</code>,
yielded in reverse order along with the index of the match.</p>
<p>For matches of <code>pat</code> within <code>self</code> that overlap, only the indices
corresponding to the last match are returned.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator requires that the pattern supports a reverse
search, and it will be a <ahref="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if a forward/reverse
search yields the same elements.</p>
<p>For iterating from the front, the <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.match_indices"><code>match_indices</code></a> method can be used.</p>
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="ident">v</span>, [(<spanclass="number">2</span>, <spanclass="string">"aba"</span>)]); <spanclass="comment">// only the last `aba`</span></pre></div>
without modifying the original"]</span>pub fn <ahref="#method.trim"class="fnname">trim</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1726"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns a string slice with leading and trailing whitespace removed.</p>
<p>'Whitespace' is defined according to the terms of the Unicode Derived
"this returns the trimmed string as a new slice, \
without modifying the original"]</span>pub fn <ahref="#method.trim_start"class="fnname">trim_start</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><spanclass="since"title="Stable since Rust version 1.30.0">1.30.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1764"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns a string slice with leading whitespace removed.</p>
<p>'Whitespace' is defined according to the terms of the Unicode Derived
"this returns the trimmed string as a new slice, \
without modifying the original"]</span>pub fn <ahref="#method.trim_end"class="fnname">trim_end</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><spanclass="since"title="Stable since Rust version 1.30.0">1.30.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1802"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns a string slice with trailing whitespace removed.</p>
<p>'Whitespace' is defined according to the terms of the Unicode Derived
</div><h4id="method.trim_left"class="method"><code>pub fn <ahref="#method.trim_left"class="fnname">trim_left</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1844"title="goto source code">[src]</a></h4><divclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span> Deprecated since 1.33.0: <p>superseded by <code>trim_start</code></p>
</div></div><divclass="docblock"><p>Returns a string slice with leading whitespace removed.</p>
<p>'Whitespace' is defined according to the terms of the Unicode Derived
</div><h4id="method.trim_right"class="method"><code>pub fn <ahref="#method.trim_right"class="fnname">trim_right</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1886"title="goto source code">[src]</a></h4><divclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span> Deprecated since 1.33.0: <p>superseded by <code>trim_end</code></p>
</div></div><divclass="docblock"><p>Returns a string slice with trailing whitespace removed.</p>
<p>'Whitespace' is defined according to the terms of the Unicode Derived
"this returns the trimmed string as a new slice, \
without modifying the original"]</span>pub fn <ahref="#method.trim_matches"class="fnname">trim_matches</a><'a, P>(&'a self, pat: P) ->&'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,<br> <P as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.DoubleEndedSearcher.html"title="trait core::str::pattern::DoubleEndedSearcher">DoubleEndedSearcher</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1919-1921"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns a string slice with all prefixes and suffixes that match a
pattern repeatedly removed.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a function
or closure that determines if a character matches.</p>
"this returns the trimmed string as a new slice, \
without modifying the original"]</span>pub fn <ahref="#method.trim_start_matches"class="fnname">trim_start_matches</a><'a, P>(&'a self, pat: P) ->&'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.30.0">1.30.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#1968"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns a string slice with all prefixes that match a pattern
repeatedly removed.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
"this returns the remaining substring as a new slice, \
without modifying the original"]</span>pub fn <ahref="#method.strip_prefix"class="fnname">strip_prefix</a><'a, P>(&'a self, prefix: P) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.45.0">1.45.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2001"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns a string slice with the prefix removed.</p>
<p>If the string starts with the pattern <code>prefix</code>, returns substring after the prefix, wrapped
in <code>Some</code>. Unlike <code>trim_start_matches</code>, this method removes the prefix exactly once.</p>
<p>If the string does not start with <code>prefix</code>, returns <code>None</code>.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
"this returns the remaining substring as a new slice, \
without modifying the original"]</span>pub fn <ahref="#method.strip_suffix"class="fnname">strip_suffix</a><'a, P>(&'a self, suffix: P) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,<br> <P as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.45.0">1.45.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2028-2031"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns a string slice with the suffix removed.</p>
<p>If the string ends with the pattern <code>suffix</code>, returns the substring before the suffix,
wrapped in <code>Some</code>. Unlike <code>trim_end_matches</code>, this method removes the suffix exactly once.</p>
<p>If the string does not end with <code>suffix</code>, returns <code>None</code>.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
"this returns the trimmed string as a new slice, \
without modifying the original"]</span>pub fn <ahref="#method.trim_end_matches"class="fnname">trim_end_matches</a><'a, P>(&'a self, pat: P) ->&'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,<br> <P as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.30.0">1.30.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2072-2074"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns a string slice with all suffixes that match a pattern
repeatedly removed.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div><h4id="method.trim_left_matches"class="method"><code>pub fn <ahref="#method.trim_left_matches"class="fnname">trim_left_matches</a><'a, P>(&'a self, pat: P) ->&'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2118"title="goto source code">[src]</a></h4><divclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span> Deprecated since 1.33.0: <p>superseded by <code>trim_start_matches</code></p>
</div></div><divclass="docblock"><p>Returns a string slice with all prefixes that match a pattern
repeatedly removed.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div><h4id="method.trim_right_matches"class="method"><code>pub fn <ahref="#method.trim_right_matches"class="fnname">trim_right_matches</a><'a, P>(&'a self, pat: P) ->&'a <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,<br> <P as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2161-2163"title="goto source code">[src]</a></h4><divclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span> Deprecated since 1.33.0: <p>superseded by <code>trim_end_matches</code></p>
</div></div><divclass="docblock"><p>Returns a string slice with all suffixes that match a pattern
repeatedly removed.</p>
<p>The <ahref="https://doc.rust-lang.org/nightly/core/str/pattern/index.html">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div><h4id="method.parse"class="method"><code>pub fn <ahref="#method.parse"class="fnname">parse</a><F>(&self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><F, <F as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html"title="trait core::str::traits::FromStr">FromStr</a>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err"title="type core::str::traits::FromStr::Err">Err</a>><spanclass="where fmt-newline">where<br> F: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html"title="trait core::str::traits::FromStr">FromStr</a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2213"title="goto source code">[src]</a></h4><divclass="docblock"><p>Parses this string slice into another type.</p>
<p>Because <code>parse</code> is so general, it can cause problems with type
inference. As such, <code>parse</code> is one of the few times you'll see
the syntax affectionately known as the 'turbofish': <code>::<></code>. This
helps the inference algorithm understand specifically which type
you're trying to parse into.</p>
<p><code>parse</code> can parse into any type that implements the <ahref="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html"title="FromStr"><code>FromStr</code></a> trait.</p>
<p>Will return <ahref="https://doc.rust-lang.org/nightly/core/str/traits/trait.FromStr.html#associatedtype.Err"><code>Err</code></a> if it's not possible to parse this string slice into
</div><h4id="method.is_ascii"class="method"><code>pub fn <ahref="#method.is_ascii"class="fnname">is_ascii</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2230"title="goto source code">[src]</a></h4><divclass="docblock"><p>Checks if all characters in this string are within the ASCII range.</p>
</div><h4id="method.eq_ignore_ascii_case"class="method"><code>pub fn <ahref="#method.eq_ignore_ascii_case"class="fnname">eq_ignore_ascii_case</a>(&self, other: &<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2251"title="goto source code">[src]</a></h4><divclass="docblock"><p>Checks that two strings are an ASCII case-insensitive match.</p>
<p>Same as <code>to_ascii_lowercase(a) == to_ascii_lowercase(b)</code>,
but without allocating and copying temporaries.</p>
</div><h4id="method.make_ascii_uppercase"class="method"><code>pub fn <ahref="#method.make_ascii_uppercase"class="fnname">make_ascii_uppercase</a>(&mut self)</code><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2276"title="goto source code">[src]</a></h4><divclass="docblock"><p>Converts this string to its ASCII upper case equivalent in-place.</p>
<p>ASCII letters 'a' to 'z' are mapped to 'A' to 'Z',
but non-ASCII letters are unchanged.</p>
<p>To return a new uppercased value without modifying the existing one, use
<spanclass="kw">let</span><spanclass="kw-2">mut</span><spanclass="ident">s</span><spanclass="op">=</span><spanclass="ident">String</span>::<spanclass="ident">from</span>(<spanclass="string">"Grüße, Jürgen ❤"</span>);
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="string">"GRüßE, JüRGEN ❤"</span>, <spanclass="ident">s</span>);</pre></div>
</div><h4id="method.make_ascii_lowercase"class="method"><code>pub fn <ahref="#method.make_ascii_lowercase"class="fnname">make_ascii_lowercase</a>(&mut self)</code><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2303"title="goto source code">[src]</a></h4><divclass="docblock"><p>Converts this string to its ASCII lower case equivalent in-place.</p>
<p>ASCII letters 'A' to 'Z' are mapped to 'a' to 'z',
but non-ASCII letters are unchanged.</p>
<p>To return a new lowercased value without modifying the existing one, use
<spanclass="kw">let</span><spanclass="kw-2">mut</span><spanclass="ident">s</span><spanclass="op">=</span><spanclass="ident">String</span>::<spanclass="ident">from</span>(<spanclass="string">"GRÜßE, JÜRGEN ❤"</span>);
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="string">"grÜße, jÜrgen ❤"</span>, <spanclass="ident">s</span>);</pre></div>
</div><h4id="method.escape_debug"class="method"><code>pub fn <ahref="#method.escape_debug"class="fnname">escape_debug</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.EscapeDebug.html"title="struct core::str::iter::EscapeDebug">EscapeDebug</a><'_></code><spanclass="since"title="Stable since Rust version 1.34.0">1.34.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2344"title="goto source code">[src]</a></h4><divclass="docblock"><p>Return an iterator that escapes each char in <code>self</code> with <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html#method.escape_debug"title="char::escape_debug"><code>char::escape_debug</code></a>.</p>
<p>Note: only extended grapheme codepoints that begin the string will be
</div><h4id="method.escape_default"class="method"><code>pub fn <ahref="#method.escape_default"class="fnname">escape_default</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.EscapeDefault.html"title="struct core::str::iter::EscapeDefault">EscapeDefault</a><'_></code><spanclass="since"title="Stable since Rust version 1.34.0">1.34.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2388"title="goto source code">[src]</a></h4><divclass="docblock"><p>Return an iterator that escapes each char in <code>self</code> with <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html#method.escape_default"title="char::escape_default"><code>char::escape_default</code></a>.</p>
</div><h4id="method.escape_unicode"class="method"><code>pub fn <ahref="#method.escape_unicode"class="fnname">escape_unicode</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/str/iter/struct.EscapeUnicode.html"title="struct core::str::iter::EscapeUnicode">EscapeUnicode</a><'_></code><spanclass="since"title="Stable since Rust version 1.34.0">1.34.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/str/mod.rs.html#2424"title="goto source code">[src]</a></h4><divclass="docblock"><p>Return an iterator that escapes each char in <code>self</code> with <ahref="https://doc.rust-lang.org/nightly/std/primitive.char.html#method.escape_unicode"title="char::escape_unicode"><code>char::escape_unicode</code></a>.</p>
"this returns the replaced string as a new allocation, \
without modifying the original"]</span>pub fn <ahref="#method.replace"class="fnname">replace</a><'a, P>(&'a self, from: P, to: &<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -><aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/str.rs.html#263"title="goto source code">[src]</a></h4><divclass="docblock"><p>Replaces all matches of a pattern with another string.</p>
<p><code>replace</code> creates a new <ahref="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="String"><code>String</code></a>, and copies the data from this string slice into it.
While doing so, it attempts to find matches of a pattern. If it finds any, it
replaces them with the replacement string slice.</p>
<spanclass="kw">let</span><spanclass="ident">s</span><spanclass="op">=</span><spanclass="string">"this is old"</span>;
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="string">"this is new"</span>, <spanclass="ident">s</span>.<spanclass="ident">replace</span>(<spanclass="string">"old"</span>, <spanclass="string">"new"</span>));</pre></div>
"this returns the replaced string as a new allocation, \
without modifying the original"]</span>pub fn <ahref="#method.replacen"class="fnname">replacen</a><'a, P>(&'a self, pat: P, to: &<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, count: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a><spanclass="where fmt-newline">where<br> P: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>, </span></code><spanclass="since"title="Stable since Rust version 1.16.0">1.16.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/str.rs.html#301"title="goto source code">[src]</a></h4><divclass="docblock"><p>Replaces first N matches of a pattern with another string.</p>
<p><code>replacen</code> creates a new <ahref="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="String"><code>String</code></a>, and copies the data from this string slice into it.
While doing so, it attempts to find matches of a pattern. If it finds any, it
replaces them with the replacement string slice at most <code>count</code> times.</p>
</div><h4id="method.to_lowercase"class="method"><code>pub fn <ahref="#method.to_lowercase"class="fnname">to_lowercase</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></code><spanclass="since"title="Stable since Rust version 1.2.0">1.2.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/str.rs.html#354"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns the lowercase equivalent of this string slice, as a new <ahref="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="String"><code>String</code></a>.</p>
<p>'Lowercase' is defined according to the terms of the Unicode Derived Core Property
<code>Lowercase</code>.</p>
<p>Since some characters can expand into multiple characters when changing
the case, this function returns a <ahref="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="String"><code>String</code></a> instead of modifying the
</div><h4id="method.to_uppercase"class="method"><code>pub fn <ahref="#method.to_uppercase"class="fnname">to_uppercase</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></code><spanclass="since"title="Stable since Rust version 1.2.0">1.2.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/str.rs.html#433"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns the uppercase equivalent of this string slice, as a new <ahref="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="String"><code>String</code></a>.</p>
<p>'Uppercase' is defined according to the terms of the Unicode Derived Core Property
<code>Uppercase</code>.</p>
<p>Since some characters can expand into multiple characters when changing
the case, this function returns a <ahref="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="String"><code>String</code></a> instead of modifying the
</div><h4id="method.repeat"class="method"><code>pub fn <ahref="#method.repeat"class="fnname">repeat</a>(&self, n: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></code><spanclass="since"title="Stable since Rust version 1.16.0">1.16.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/str.rs.html#492"title="goto source code">[src]</a></h4><divclass="docblock"><p>Creates a new <ahref="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="String"><code>String</code></a> by repeating a string <code>n</code> times.</p>
</div><h4id="method.to_ascii_uppercase"class="method"><code>pub fn <ahref="#method.to_ascii_uppercase"class="fnname">to_ascii_uppercase</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></code><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/str.rs.html#519"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns a copy of this string where each character is mapped to its
ASCII upper case equivalent.</p>
<p>ASCII letters 'a' to 'z' are mapped to 'A' to 'Z',
but non-ASCII letters are unchanged.</p>
<p>To uppercase the value in-place, use <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.make_ascii_uppercase"><code>make_ascii_uppercase</code></a>.</p>
<p>To uppercase ASCII characters in addition to non-ASCII characters, use
<spanclass="kw">let</span><spanclass="ident">s</span><spanclass="op">=</span><spanclass="string">"Grüße, Jürgen ❤"</span>;
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="string">"GRüßE, JüRGEN ❤"</span>, <spanclass="ident">s</span>.<spanclass="ident">to_ascii_uppercase</span>());</pre></div>
</div><h4id="method.to_ascii_lowercase"class="method"><code>pub fn <ahref="#method.to_ascii_lowercase"class="fnname">to_ascii_lowercase</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></code><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/alloc/str.rs.html#549"title="goto source code">[src]</a></h4><divclass="docblock"><p>Returns a copy of this string where each character is mapped to its
ASCII lower case equivalent.</p>
<p>ASCII letters 'A' to 'Z' are mapped to 'a' to 'z',
but non-ASCII letters are unchanged.</p>
<p>To lowercase the value in-place, use <ahref="https://doc.rust-lang.org/nightly/std/primitive.str.html#method.make_ascii_lowercase"><code>make_ascii_lowercase</code></a>.</p>
<p>To lowercase ASCII characters in addition to non-ASCII characters, use
<spanclass="kw">let</span><spanclass="ident">s</span><spanclass="op">=</span><spanclass="string">"Grüße, Jürgen ❤"</span>;
<spanclass="macro">assert_eq</span><spanclass="macro">!</span>(<spanclass="string">"grüße, jürgen ❤"</span>, <spanclass="ident">s</span>.<spanclass="ident">to_ascii_lowercase</span>());</pre></div>
</div></div><h3id="impl-LazyStatic"class="impl"><codeclass="in-band">impl <aclass="trait"href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html"title="trait lazy_static::LazyStatic">LazyStatic</a> for <aclass="struct"href="../../abstio/abst_paths/struct.ROOT_DIR.html"title="struct abstio::abst_paths::ROOT_DIR">ROOT_DIR</a></code><ahref="#impl-LazyStatic"class="anchor"></a><aclass="srclink"href="../../src/abstio/abst_paths.rs.html#10-49"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.initialize"class="method hidden"><code>fn <ahref="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html#tymethod.initialize"class="fnname">initialize</a>(lazy: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><aclass="srclink"href="../../src/abstio/abst_paths.rs.html#10-49"title="goto source code">[src]</a></h4></div></div><h2id="synthetic-implementations"class="small-section-header">Auto Trait Implementations<ahref="#synthetic-implementations"class="anchor"></a></h2><divid="synthetic-implementations-list"><h3id="impl-RefUnwindSafe"class="impl"><codeclass="in-band">impl <aclass="trait"href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html"title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <aclass="struct"href="../../abstio/abst_paths/struct.ROOT_DIR.html"title="struct abstio::abst_paths::ROOT_DIR">ROOT_DIR</a></code><ahref="#impl-RefUnwindSafe"class="anchor"></a><aclass="srclink"href="../../src/abstio/lib.rs.html#1"title="goto source code">[src]</a></h3><divclass="impl-items"></div><h3id="impl-Send"class="impl"><codeclass="in-band">impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html"title="trait core::marker::Send">Send</a> for <aclass="struct"href="../../abstio/abst_paths/struct.ROOT_DIR.html"title="struct abstio::abst_paths::ROOT_DIR">ROOT_DIR</a></code><ahref="#impl-Send"class="anchor"></a><aclass="srclink"href="../../src/abstio/lib.rs.html#1"title="goto source code">[src]</a></h3><divclass="impl-items"></div><h3id="impl-Sync"class="impl"><codeclass="in-band">impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html"title="trait core::marker::Sync">Sync</a> for <aclass="struct"href="../../abstio/abst_paths/struct.ROOT_DIR.html"title="struct abstio::abst_paths::ROOT_DIR">ROOT_DIR</a></code><ahref="#impl-Sync"class="anchor"></a><aclass="srclink"href="../../src/abstio/lib.rs.html#1"title="goto source code">[src]</a></h3><divclass="impl-items"></div><h3id="impl-Unpin"class="impl"><codeclass="in-band">impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html"title="trait core::marker::Unpin">Unpin</a> for <aclass="struct"href="../../abstio/abst_paths/struct.ROOT_DIR.html"title="struct abstio::abst_paths::ROOT_DIR">ROOT_DIR</a></code><ahref="#impl-Unpin"class="anchor"></a><aclass="srclink"href="../../src/abstio/lib.rs.html#1"title="goto source code">[src]</a></h3><divclass="impl-items"></div><h3id="impl-UnwindSafe"class="impl"><codeclass="in-band">impl <aclass="trait"href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html"title="trait std::panic::UnwindSafe">UnwindSafe</a> for <aclass="struct"href="../../abstio/abst_paths/struct.ROOT_DIR.html"title="struct abstio::abst_paths::ROOT_DIR">ROOT_DIR</a></code><ahref="#impl-UnwindSafe"class="anchor"></a><aclass="srclink"href="../../src/abstio/lib.rs.html#1"title="goto source code">[src]</a></h3><divclass="impl-items"></div></div><h2id="blanket-implementations"class="small-section-header">Blanket Implementations<ahref="#blanket-implementations"class="anchor"></a></h2><divid="blanket-implementations-list"><h3id="impl-Any"class="impl"><codeclass="in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a> for T <spanclass="where fmt-newline">where<br>
</div></div><h3id="impl-Borrow%3CT%3E"class="impl"><codeclass="in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html"title="trait core::borrow::Borrow">Borrow</a><T> for T <spanclass="where fmt-newline">where<br> T: ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref="#impl-Borrow%3CT%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#207-211"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.borrow"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow"class="fnname">borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3id="impl-BorrowMut%3CT%3E"class="impl"><codeclass="in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html"title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <spanclass="where fmt-newline">where<br> T: ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref="#impl-BorrowMut%3CT%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-218"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.borrow_mut"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut"class="fnname">borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#215"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Mutably borrows from an owned value. <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3id="impl-From%3CT%3E"class="impl"><codeclass="in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for T</code><ahref="#impl-From%3CT%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-549"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.from"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from"class="fnname">from</a>(t: T) -> T</code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#546"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id="impl-Instrument"class="impl"><codeclass="in-band">impl<T><aclass="trait"href="https://docs.rs/tracing/0.1.23/tracing/instrument/trait.Instrument.html"title="trait tracing::instrument::Instrument">Instrument</a> for T</code><ahref="#impl-Instrument"class="anchor"></a><aclass="srclink"href="https://docs.rs/tracing/0.1.23/src/tracing/instrument.rs.html#155"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.instrument"class="method hidden"><code>pub fn <ahref="https://docs.rs/tracing/0.1.23/tracing/instrument/trait.Instrument.html#method.instrument"class="fnname">instrument</a>(self, span: <aclass="struct"href="https://docs.rs/tracing/0.1.23/tracing/span/struct.Span.html"title="struct tracing::span::Span">Span</a>) -><aclass="struct"href="https://docs.rs/tracing/0.1.23/tracing/instrument/struct.Instrumented.html"title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><aclass="srclink"href="https://docs.rs/tracing/0.1.23/src/tracing/instrument.rs.html#38"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
</div><h4id="method.in_current_span"class="method hidden"><code>pub fn <ahref="https://docs.rs/tracing/0.1.23/tracing/instrument/trait.Instrument.html#method.in_current_span"class="fnname">in_current_span</a>(self) -><aclass="struct"href="https://docs.rs/tracing/0.1.23/tracing/instrument/struct.Instrumented.html"title="struct tracing::instrument::Instrumented">Instrumented</a><Self></code><aclass="srclink"href="https://docs.rs/tracing/0.1.23/src/tracing/instrument.rs.html#74"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Instruments this type with the <ahref="../struct.Span.html#method.current">current</a><code>Span</code>, returning an
</div></div><h3id="impl-Instrument-1"class="impl"><codeclass="in-band">impl<T><aclass="trait"href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html"title="trait tracing_futures::Instrument">Instrument</a> for T</code><ahref="#impl-Instrument-1"class="anchor"></a><aclass="srclink"href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#248"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.instrument-1"class="method hidden"><code>pub fn <ahref="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.instrument"class="fnname">instrument</a>(self, span: <aclass="struct"href="https://docs.rs/tracing/0.1.23/tracing/span/struct.Span.html"title="struct tracing::span::Span">Span</a>) -><aclass="struct"href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html"title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><aclass="srclink"href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#129"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Instruments this type with the provided <code>Span</code>, returning an
</div><h4id="method.in_current_span-1"class="method hidden"><code>pub fn <ahref="https://docs.rs/tracing-futures/0.2.3/tracing_futures/trait.Instrument.html#method.in_current_span"class="fnname">in_current_span</a>(self) -><aclass="struct"href="https://docs.rs/tracing-futures/0.2.3/tracing_futures/struct.Instrumented.html"title="struct tracing_futures::Instrumented">Instrumented</a><Self></code><aclass="srclink"href="https://docs.rs/tracing-futures/0.2.3/src/tracing_futures/lib.rs.html#166"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Instruments this type with the <ahref="https://docs.rs/tracing/latest/tracing/span/struct.Span.html#method.current">current</a><code>Span</code>, returning an
</div></div><h3id="impl-Into%3CU%3E"class="impl"><codeclass="in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html"title="trait core::convert::From">From</a><T>, </span></code><ahref="#impl-Into%3CU%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#534-541"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="method.into"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into"class="fnname">into</a>(self) -> U</code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#538"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id="impl-TryFrom%3CU%3E"class="impl"><codeclass="in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>, </span></code><ahref="#impl-TryFrom%3CU%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#582-591"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="associatedtype.Error"class="type"><code>type <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"class="type">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></code></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id="method.try_from"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from"class="fnname">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id="impl-TryInto%3CU%3E"class="impl"><codeclass="in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><ahref="#impl-TryInto%3CU%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#568-577"title="goto source code">[src]</a></h3><divclass="impl-items"><h4id="associatedtype.Error-1"class="type"><code>type <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error"class="type">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></code></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id="method.try_into"class="method hidden"><code>pub fn <ahref="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into"class="fnname">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></code><aclass="srclink"href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#574"title="goto source code">[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>