<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="A UTF-8-encoded fixed string"><title>Str in clap::builder - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><linkrel="stylesheet"href="../../static.files/normalize-76eba96aa4d2e634.css"><linkrel="stylesheet"href="../../static.files/rustdoc-ac92e1bbe349e143.css"><metaname="rustdoc-vars"data-root-path="../../"data-static-root-path="../../static.files/"data-current-crate="clap"data-themes=""data-resource-suffix=""data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)"data-channel="1.76.0"data-search-js="search-2b6ce74ff89ae146.js"data-settings-js="settings-4313503d2e1961c2.js"><scriptsrc="../../static.files/storage-f2adc0d6ca4d09fb.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../../static.files/main-305769736d49e732.js"></script><noscript><linkrel="stylesheet"href="../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><linkrel="alternate icon"type="image/png"href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><linkrel="alternate icon"type="image/png"href="../../static.files/favicon-32x32-422f7d1d52889060.png"><linkrel="icon"type="image/svg+xml"href="../../static.files/favicon-2c020d218678b618.svg"></head><bodyclass="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle">☰</button><aclass="logo-container"href="../../clap/index.html"><imgsrc="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png"alt=""></a></nav><navclass="sidebar"><divclass="sidebar-crate"><aclass="logo-container"href="../../clap/index.html"><imgsrc="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png"alt="logo"></a><h2><ahref="../../clap/index.html">clap</a><spanclass="version">4.5.2</span></h2></div><h2class="location"><ahref="#">Str</a></h2><divclass="sidebar-elems"><section><h3><ahref="#implementations">Methods</a></h3><ulclass="block method"><li><ahref="#method.as_str">as_str</a></li></ul><h3><ahref="#deref-methods-str">Methods from Deref<Target=str></a></h3><ulclass="block deref-methods"><li><ahref="#method.as_ascii">as_ascii</a></li><li><ahref="#method.as_bytes">as_bytes</a></li><li><ahref="#method.as_ptr">as_ptr</a></li><li><ahref="#method.bytes">bytes</a></li><li><ahref="#method.ceil_char_boundary">ceil_char_boundary</a></li><li><ahref="#method.char_indices">char_indices</a></li><li><ahref="#method.chars">chars</a></li><li><ahref="#method.contains">contains</a></li><li><ahref="#method.encode_utf16">encode_utf16</a></li><li><ahref="#method.ends_with">ends_with</a></li><li><ahref="#method.eq_ignore_ascii_case">eq_ignore_ascii_case</a></li><li><ahref="#method.escape_debug">escape_debug</a></li><li><ahref="#method.escape_default">escape_default</a></li><li><ahref="#method.escape_unicode">escape_unicode</a></li><li><ahref="#method.find">find</a></li><li><ahref="#method.floor_char_boundary">floor_char_boundary</a></li><li><ahref="#method.get">get</a></li><li><ahref="#method.get_unchecked">get_unchecked</a></li><li><ahref="#method.is_ascii">is_ascii</a></li><li><ahref="#method.is_char_boundary">is_char_boundary</a></li><li><ahref="#meth
<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../../clap/all.html"title="show sidebar"></a></div><inputclass="search-input"name="search"aria-label="Run search in the documentation"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><divid="help-button"tabindex="-1"><ahref="../../help.html"title="help">?</a></div><divid="settings-menu"tabindex="-1"><ahref="../../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><sectionid="main-content"class="content"><divclass="main-heading"><h1>Struct <ahref="../index.html">clap</a>::<wbr><ahref="index.html">builder</a>::<wbr><aclass="struct"href="#">Str</a><buttonid="copy-path"title="Copy item path to clipboard"><imgsrc="../../static.files/clipboard-7571035ce49a181d.svg"width="19"height="18"alt="Copy item path"></button></h1><spanclass="out-of-band"><aclass="src"href="../../src/clap_builder/builder/str.rs.html#6">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><preclass="rust item-decl"><code>pub struct Str { <spanclass="comment">/* private fields */</span> }</code></pre><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>A UTF-8-encoded fixed string</p>
<p><strong>NOTE:</strong> To support dynamic values (i.e. <code>String</code>), enable the <code>string</code>
feature</p>
</div></details><h2id="implementations"class="section-header">Implementations<ahref="#implementations"class="anchor">§</a></h2><divid="implementations-list"><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#10">source</a><ahref="#impl-Str"class="anchor">§</a><h3class="code-header">impl <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_str"class="method"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#36">source</a><h4class="code-header">pub fn <ahref="#method.as_str"class="fn">as_str</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section></summary><divclass="docblock"><p>Get the raw string of the <code>Str</code></p>
</div></details></div></details></div><h2id="deref-methods-str"class="section-header"><span>Methods from <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/ops/deref/trait.Deref.html"title="trait core::ops::deref::Deref">Deref</a><Target = <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>></span><ahref="#deref-methods-str"class="anchor">§</a></h2><divid="deref-methods-str-1"class="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.len"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#164">source</a></span><h4class="code-header">pub fn <ahref="#method.len"class="fn">len</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Returns the length of <code>self</code>.</p>
<p>This length is in bytes, not <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s or graphemes. In other words,
it might not be what a human considers the length of the string.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_empty"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#183">source</a></span><h4class="code-header">pub fn <ahref="#method.is_empty"class="fn">is_empty</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if <code>self</code> has a length of zero bytes.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_char_boundary"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.9.0">1.9.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#213">source</a></span><h4class="code-header">pub fn <ahref="#method.is_char_boundary"class="fn">is_char_boundary</a>(&self, index: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><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></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.floor_char_boundary"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#260">source</a><h4class="code-header">pub fn <ahref="#method.floor_char_boundary"class="fn">floor_char_boundary</a>(&self, index: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>round_char_boundary</code>)</span></div></span></summary><divclass="docblock"><p>Finds the closest <code>x</code> not exceeding <code>index</code> where <code>is_char_boundary(x)</code> is <code>true</code>.</p>
<p>This method can help you truncate a string so that it’s still valid UTF-8, but doesn’t
exceed a given number of bytes. Note that this is done purely at the character level
and can still visually split graphemes, even though the underlying characters aren’t
split. For example, the emoji 🧑🔬 (scientist) could be split so that the string only
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ceil_char_boundary"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#298">source</a><h4class="code-header">pub fn <ahref="#method.ceil_char_boundary"class="fn">ceil_char_boundary</a>(&self, index: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>round_char_boundary</code>)</span></div></span></summary><divclass="docblock"><p>Finds the closest <code>x</code> not below <code>index</code> where <code>is_char_boundary(x)</code> is <code>true</code>.</p>
<p>If <code>index</code> is greater than the length of the string, this returns the length of the string.</p>
<p>This method is the natural complement to <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.floor_char_boundary"title="method str::floor_char_boundary"><code>floor_char_boundary</code></a>. See that method
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_bytes"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#324">source</a></span><h4class="code-header">pub fn <ahref="#method.as_bytes"class="fn">as_bytes</a>(&self) ->&[<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>] <ahref="#"class="tooltip"data-notable-ty="&[u8]">ⓘ</a></h4></section></summary><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/1.76.0/core/str/converts/fn.from_utf8.html"title="fn core::str::converts::from_utf8"><code>from_utf8</code></a> function.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ptr"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#398">source</a></span><h4class="code-header">pub fn <ahref="#method.as_ptr"class="fn">as_ptr</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.pointer.html">*const </a><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a></h4></section></summary><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/1.76.0/std/primitive.u8.html"title="primitive 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/1.76.0/std/primitive.str.html#method.as_mut_ptr"title="method str::as_mut_ptr"><code>as_mut_ptr</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.20.0">1.20.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#439">source</a></span><h4class="code-header">pub fn <ahref="#method.get"class="fn">get</a><I>(&self, i: I) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<I as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html#associatedtype.Output"title="type core::slice::index::SliceIndex::Output">Output</a>><divclass="where">where
I: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>>,</div></h4></section></summary><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/1.76.0/core/option/enum.Option.html#variant.None"title="variant core::option::Option::None"><code>None</code></a> whenever equivalent indexing operation would panic.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_unchecked"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.20.0">1.20.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#503">source</a></span><h4class="code-header">pub unsafe fn <ahref="#method.get_unchecked"class="fn">get_unchecked</a><I>(&self, i: I) ->&<I as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html#associatedtype.Output"title="type core::slice::index::SliceIndex::Output">Output</a><divclass="where">where
I: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>>,</div></h4></section></summary><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>
<h5id="safety"><ahref="#safety">Safety</a></h5>
<p>Callers of this function are responsible that these preconditions are
satisfied:</p>
<ul>
<li>The starting index must not exceed the ending index;</li>
<li>Indexes must be within bounds of the original slice;</li>
<li>Indexes must lie on UTF-8 sequence boundaries.</li>
</ul>
<p>Failing that, the returned string slice may reference invalid memory or
violate the invariants communicated by the <code>str</code> type.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.slice_unchecked"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#589">source</a></span><h4class="code-header">pub unsafe fn <ahref="#method.slice_unchecked"class="fn">slice_unchecked</a>(&self, begin: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>, end: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 1.29.0: use <code>get_unchecked(begin..end)</code> instead</span></div></span></summary><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/1.76.0/std/primitive.str.html"title="primitive str"><code>str</code></a> and <ahref="https://doc.rust-lang.org/1.76.0/core/ops/index/trait.Index.html"title="trait core::ops::index::Index"><code>Index</code></a>.</p>
<p>This new slice goes from <code>begin</code> to <code>end</code>, including <code>begin</code> but
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_at"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.4.0">1.4.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#660">source</a></span><h4class="code-header">pub fn <ahref="#method.split_at"class="fn">split_at</a>(&self, mid: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -> (&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>, &<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>)</h4></section></summary><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/1.76.0/std/primitive.str.html#method.split_at_mut"title="method str::split_at_mut"><code>split_at_mut</code></a>
method.</p>
<h5id="panics"><ahref="#panics">Panics</a></h5>
<p>Panics if <code>mid</code> is not on a UTF-8 code point boundary, or if it is
past the end of the last code point of the string slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.chars"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#768">source</a></span><h4class="code-header">pub fn <ahref="#method.chars"class="fn">chars</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.Chars.html"title="struct core::str::iter::Chars">Chars</a><'_></h4></section></summary><divclass="docblock"><p>Returns an iterator over the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>. This method returns such an iterator.</p>
<p>It’s important to remember that <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a> represents a Unicode Scalar
Value, and might 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/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s might not match your intuition about characters:</p>
<spanclass="macro">assert_eq!</span>(<spanclass="prelude-val">Some</span>(<spanclass="string">'y'</span>), chars.next()); <spanclass="comment">// not 'y̆'
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.char_indices"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#825">source</a></span><h4class="code-header">pub fn <ahref="#method.char_indices"class="fn">char_indices</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.CharIndices.html"title="struct core::str::iter::CharIndices">CharIndices</a><'_></h4></section></summary><divclass="docblock"><p>Returns an iterator over the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>. This method returns an iterator of both
these <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a> is
<p>Remember, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s might not match your intuition about characters:</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.bytes"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#848">source</a></span><h4class="code-header">pub fn <ahref="#method.bytes"class="fn">bytes</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.Bytes.html"title="struct core::str::iter::Bytes">Bytes</a><'_></h4></section></summary><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></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_whitespace"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.1.0">1.1.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#900">source</a></span><h4class="code-header">pub fn <ahref="#method.split_whitespace"class="fn">split_whitespace</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.SplitWhitespace.html"title="struct core::str::iter::SplitWhitespace">SplitWhitespace</a><'_></h4></section></summary><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/1.76.0/std/primitive.str.html#method.split_ascii_whitespace"title="method str::split_ascii_whitespace"><code>split_ascii_whitespace</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_ascii_whitespace"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.34.0">1.34.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#949">source</a></span><h4class="code-header">pub fn <ahref="#method.split_ascii_whitespace"class="fn">split_ascii_whitespace</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.SplitAsciiWhitespace.html"title="struct core::str::iter::SplitAsciiWhitespace">SplitAsciiWhitespace</a><'_></h4></section></summary><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/1.76.0/std/primitive.str.html#method.split_whitespace"title="method str::split_whitespace"><code>split_whitespace</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.lines"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1002">source</a></span><h4class="code-header">pub fn <ahref="#method.lines"class="fn">lines</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.Lines.html"title="struct core::str::iter::Lines">Lines</a><'_></h4></section></summary><divclass="docblock"><p>An iterator over the lines of a string, as string slices.</p>
<p>Lines are split at line endings that are either newlines (<code>\n</code>) or
sequences of a carriage return followed by a line feed (<code>\r\n</code>).</p>
<p>Line terminators are not included in the lines returned by the iterator.</p>
<p>Note that any carriage return (<code>\r</code>) not immediately followed by a
line feed (<code>\n</code>) does not split a line. These carriage returns are
thereby included in the produced lines.</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></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.lines_any"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1011">source</a></span><h4class="code-header">pub fn <ahref="#method.lines_any"class="fn">lines_any</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.LinesAny.html"title="struct core::str::iter::LinesAny">LinesAny</a><'_></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 1.4.0: use lines() instead now</span></div></span></summary><divclass="docblock"><p>An iterator over the lines of a string.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.encode_utf16"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.8.0">1.8.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1030">source</a></span><h4class="code-header">pub fn <ahref="#method.encode_utf16"class="fn">encode_utf16</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.EncodeUtf16.html"title="struct core::str::iter::EncodeUtf16">EncodeUtf16</a><'_></h4></section></summary><divclass="docblock"><p>Returns an iterator of <code>u16</code> over the string encoded as UTF-16.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.contains"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1055">source</a></span><h4class="code-header">pub fn <ahref="#method.contains"class="fn">contains</a><'a, P>(&'a self, pat: P) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.starts_with"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1079">source</a></span><h4class="code-header">pub fn <ahref="#method.starts_with"class="fn">starts_with</a><'a, P>(&'a self, pat: P) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/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/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.find"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1154">source</a></span><h4class="code-header">pub fn <ahref="#method.find"class="fn">find</a><'a, P>(&'a self, pat: P) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><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/1.76.0/core/option/enum.Option.html#variant.None"title="variant core::option::Option::None"><code>None</code></a> if the pattern doesn’t match.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/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/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Returns the byte index for the first character of the last match of the pattern in
this string slice.</p>
<p>Returns <ahref="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html#variant.None"title="variant core::option::Option::None"><code>None</code></a> if the pattern doesn’t match.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1322">source</a></span><h4class="code-header">pub fn <ahref="#method.split"class="fn">split</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.Split.html"title="struct core::str::iter::Split">Split</a><'a, P><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="trait core::iter::traits::double_ended::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/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/std/primitive.str.html#method.rsplit"title="method str::rsplit"><code>rsplit</code></a> method can be used.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>v: Vec<<spanclass="kw-2">&</span>str> = <spanclass="string">"Mary had a little lamb"</span>.split(<spanclass="string">' '</span>).collect();
<divclass="example-wrap ignore"><ahref="#"class="tooltip"title="This example is not tested">ⓘ</a><preclass="rust rust-example-rendered"><code><spanclass="macro">assert_eq!</span>(d, <spanclass="kw-2">&</span>[<spanclass="string">"a"</span>, <spanclass="string">"b"</span>, <spanclass="string">"c"</span>]);</code></pre></div>
<p>Use <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.split_whitespace"title="method str::split_whitespace"><code>split_whitespace</code></a> for this behavior.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_inclusive"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.51.0">1.51.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1362">source</a></span><h4class="code-header">pub fn <ahref="#method.split_inclusive"class="fn">split_inclusive</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.SplitInclusive.html"title="struct core::str::iter::SplitInclusive">SplitInclusive</a><'a, P><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>v: Vec<<spanclass="kw-2">&</span>str> = <spanclass="string">"Mary had a little lamb\nlittle lamb\nlittle lamb."
<spanclass="macro">assert_eq!</span>(v, [<spanclass="string">"Mary had a little lamb\n"</span>, <spanclass="string">"little lamb\n"</span>, <spanclass="string">"little lamb."</span>]);</code></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>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>v: Vec<<spanclass="kw-2">&</span>str> = <spanclass="string">"Mary had a little lamb\nlittle lamb\nlittle lamb.\n"
<spanclass="macro">assert_eq!</span>(v, [<spanclass="string">"Mary had a little lamb\n"</span>, <spanclass="string">"little lamb\n"</span>, <spanclass="string">"little lamb.\n"</span>]);</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rsplit"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1417-1419">source</a></span><h4class="code-header">pub fn <ahref="#method.rsplit"class="fn">rsplit</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.RSplit.html"title="struct core::str::iter::RSplit">RSplit</a><'a, P><divclass="where">where
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/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/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="trait core::iter::traits::double_ended::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/1.76.0/std/primitive.str.html#method.split"title="method str::split"><code>split</code></a> method can be used.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>v: Vec<<spanclass="kw-2">&</span>str> = <spanclass="string">"Mary had a little lamb"</span>.rsplit(<spanclass="string">' '</span>).collect();
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_terminator"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1466">source</a></span><h4class="code-header">pub fn <ahref="#method.split_terminator"class="fn">split_terminator</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.SplitTerminator.html"title="struct core::str::iter::SplitTerminator">SplitTerminator</a><'a, P><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/std/primitive.str.html#method.split"title="method str::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/1.76.0/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="trait core::iter::traits::double_ended::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/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/std/primitive.str.html#method.rsplit_terminator"title="method str::rsplit_terminator"><code>rsplit_terminator</code></a> method can be used.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/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/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/std/primitive.str.html#method.split"title="method str::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/1.76.0/std/primitive.str.html#method.split_terminator"title="method str::split_terminator"><code>split_terminator</code></a> method can be
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.splitn"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1567">source</a></span><h4class="code-header">pub fn <ahref="#method.splitn"class="fn">splitn</a><'a, P>(&'a self, n: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.SplitN.html"title="struct core::str::iter::SplitN">SplitN</a><'a, P><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/std/primitive.str.html#method.rsplitn"title="method str::rsplitn"><code>rsplitn</code></a> method can be
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>v: Vec<<spanclass="kw-2">&</span>str> = <spanclass="string">"Mary had a little lambda"</span>.splitn(<spanclass="number">3</span>, <spanclass="string">' '</span>).collect();
<spanclass="macro">assert_eq!</span>(v, [<spanclass="string">"Mary"</span>, <spanclass="string">"had"</span>, <spanclass="string">"a little lambda"</span>]);
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/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/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/std/primitive.str.html#method.splitn"title="method str::splitn"><code>splitn</code></a> method can be used.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>v: Vec<<spanclass="kw-2">&</span>str> = <spanclass="string">"Mary had a little lamb"</span>.rsplitn(<spanclass="number">3</span>, <spanclass="string">' '</span>).collect();
<spanclass="macro">assert_eq!</span>(v, [<spanclass="string">"lamb"</span>, <spanclass="string">"little"</span>, <spanclass="string">"Mary had a"</span>]);
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_once"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.52.0">1.52.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1636">source</a></span><h4class="code-header">pub fn <ahref="#method.split_once"class="fn">split_once</a><'a, P>(&'a self, delimiter: P) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(&'a <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>, &'a <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>)><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Splits the string on the first occurrence of the specified delimiter and
returns prefix before delimiter and suffix after delimiter.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/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/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Splits the string on the last occurrence of the specified delimiter and
returns prefix before delimiter and suffix after delimiter.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.matches"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.2.0">1.2.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1694">source</a></span><h4class="code-header">pub fn <ahref="#method.matches"class="fn">matches</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.Matches.html"title="struct core::str::iter::Matches">Matches</a><'a, P><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="trait core::iter::traits::double_ended::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/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/std/primitive.str.html#method.rmatches"title="method str::rmatches"><code>rmatches</code></a> method can be used.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/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/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="trait core::iter::traits::double_ended::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/1.76.0/std/primitive.str.html#method.matches"title="method str::matches"><code>matches</code></a> method can be used.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.match_indices"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.5.0">1.5.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1772">source</a></span><h4class="code-header">pub fn <ahref="#method.match_indices"class="fn">match_indices</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.MatchIndices.html"title="struct core::str::iter::MatchIndices">MatchIndices</a><'a, P><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="trait core::iter::traits::double_ended::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/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/std/primitive.str.html#method.rmatch_indices"title="method str::rmatch_indices"><code>rmatch_indices</code></a> method can be used.</p>
<spanclass="macro">assert_eq!</span>(v, [(<spanclass="number">0</span>, <spanclass="string">"aba"</span>)]); <spanclass="comment">// only the first `aba`</span></code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rmatch_indices"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.5.0">1.5.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1812-1814">source</a></span><h4class="code-header">pub fn <ahref="#method.rmatch_indices"class="fn">rmatch_indices</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.RMatchIndices.html"title="struct core::str::iter::RMatchIndices">RMatchIndices</a><'a, P><divclass="where">where
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/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/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><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/1.76.0/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="trait core::iter::traits::double_ended::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/1.76.0/std/primitive.str.html#method.match_indices"title="method str::match_indices"><code>match_indices</code></a> method can be used.</p>
<spanclass="macro">assert_eq!</span>(v, [(<spanclass="number">2</span>, <spanclass="string">"aba"</span>)]); <spanclass="comment">// only the last `aba`</span></code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1836">source</a></span><h4class="code-header">pub fn <ahref="#method.trim"class="fn">trim</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section></summary><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
Core Property <code>White_Space</code>, which includes newlines.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_start"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.30.0">1.30.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1875">source</a></span><h4class="code-header">pub fn <ahref="#method.trim_start"class="fn">trim_start</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section></summary><divclass="docblock"><p>Returns a string slice with leading whitespace removed.</p>
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
Core Property <code>White_Space</code>, which includes newlines.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_end"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.30.0">1.30.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1914">source</a></span><h4class="code-header">pub fn <ahref="#method.trim_end"class="fn">trim_end</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section></summary><divclass="docblock"><p>Returns a string slice with trailing whitespace removed.</p>
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
Core Property <code>White_Space</code>, which includes newlines.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_left"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1954">source</a></span><h4class="code-header">pub fn <ahref="#method.trim_left"class="fn">trim_left</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 1.33.0: superseded by <code>trim_start</code></span></div></span></summary><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></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_right"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1994">source</a></span><h4class="code-header">pub fn <ahref="#method.trim_right"class="fn">trim_right</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 1.33.0: superseded by <code>trim_end</code></span></div></span></summary><divclass="docblock"><p>Returns a string slice with trailing whitespace removed.</p>
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/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/1.76.0/core/str/pattern/trait.DoubleEndedSearcher.html"title="trait core::str::pattern::DoubleEndedSearcher">DoubleEndedSearcher</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a function
or closure that determines if a character matches.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="macro">assert_eq!</span>(<spanclass="string">"1foo1barXX"</span>.trim_matches(|c| c == <spanclass="string">'1' </span>|| c == <spanclass="string">'X'</span>), <spanclass="string">"foo1bar"</span>);</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_start_matches"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.30.0">1.30.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2074">source</a></span><h4class="code-header">pub fn <ahref="#method.trim_start_matches"class="fn">trim_start_matches</a><'a, P>(&'a self, pat: P) ->&'a <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.strip_prefix"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.45.0">1.45.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2107">source</a></span><h4class="code-header">pub fn <ahref="#method.strip_prefix"class="fn">strip_prefix</a><'a, P>(&'a self, prefix: P) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&'a <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/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/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/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/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="macro">assert_eq!</span>(<spanclass="string">"1fooX"</span>.trim_end_matches(|c| c == <spanclass="string">'1' </span>|| c == <spanclass="string">'X'</span>), <spanclass="string">"1foo"</span>);</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_left_matches"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2222">source</a></span><h4class="code-header">pub fn <ahref="#method.trim_left_matches"class="fn">trim_left_matches</a><'a, P>(&'a self, pat: P) ->&'a <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 1.33.0: superseded by <code>trim_start_matches</code></span></div></span></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/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/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 1.33.0: superseded by <code>trim_end_matches</code></span></div></span></summary><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/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="macro">assert_eq!</span>(<spanclass="string">"1fooX"</span>.trim_right_matches(|c| c == <spanclass="string">'1' </span>|| c == <spanclass="string">'X'</span>), <spanclass="string">"1foo"</span>);</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.parse"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2317">source</a></span><h4class="code-header">pub fn <ahref="#method.parse"class="fn">parse</a><F>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><F, <F as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/traits/trait.FromStr.html"title="trait core::str::traits::FromStr">FromStr</a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/str/traits/trait.FromStr.html#associatedtype.Err"title="type core::str::traits::FromStr::Err">Err</a>><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/traits/trait.FromStr.html"title="trait core::str::traits::FromStr">FromStr</a>,</div></h4></section></summary><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/1.76.0/core/str/traits/trait.FromStr.html"title="trait core::str::traits::FromStr"><code>FromStr</code></a> trait.</p>
<h5id="errors"><ahref="#errors">Errors</a></h5>
<p>Will return <ahref="https://doc.rust-lang.org/1.76.0/core/str/traits/trait.FromStr.html#associatedtype.Err"title="associated type core::str::traits::FromStr::Err"><code>Err</code></a> if it’s not possible to parse this string slice into
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_ascii"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2336">source</a></span><h4class="code-header">pub fn <ahref="#method.is_ascii"class="fn">is_ascii</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Checks if all characters in this string are within the ASCII range.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ascii"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2348">source</a><h4class="code-header">pub fn <ahref="#method.as_ascii"class="fn">as_ascii</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&[<aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/ascii/ascii_char/enum.AsciiChar.html"title="enum core::ascii::ascii_char::AsciiChar">AsciiChar</a>]></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>ascii_char</code>)</span></div></span></summary><divclass="docblock"><p>If this string slice <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.is_ascii"title="method str::is_ascii"><code>is_ascii</code></a>, returns it as a slice
of <ahref="https://doc.rust-lang.org/1.76.0/core/ascii/ascii_char/enum.AsciiChar.html"title="enum core::ascii::ascii_char::AsciiChar">ASCII characters</a>, otherwise returns <code>None</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq_ignore_ascii_case"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2368">source</a></span><h4class="code-header">pub fn <ahref="#method.eq_ignore_ascii_case"class="fn">eq_ignore_ascii_case</a>(&self, other: &<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><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></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_ascii_start"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2446">source</a><h4class="code-header">pub fn <ahref="#method.trim_ascii_start"class="fn">trim_ascii_start</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>byte_slice_trim_ascii</code>)</span></div></span></summary><divclass="docblock"><p>Returns a string slice with leading ASCII whitespace removed.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_ascii"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2499">source</a><h4class="code-header">pub fn <ahref="#method.trim_ascii"class="fn">trim_ascii</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>byte_slice_trim_ascii</code>)</span></div></span></summary><divclass="docblock"><p>Returns a string slice with leading and trailing ASCII whitespace
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.escape_debug"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.34.0">1.34.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2542">source</a></span><h4class="code-header">pub fn <ahref="#method.escape_debug"class="fn">escape_debug</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.EscapeDebug.html"title="struct core::str::iter::EscapeDebug">EscapeDebug</a><'_></h4></section></summary><divclass="docblock"><p>Return an iterator that escapes each char in <code>self</code> with <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html#method.escape_debug"title="method char::escape_debug"><code>char::escape_debug</code></a>.</p>
<p>Note: only extended grapheme codepoints that begin the string will be
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.escape_default"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.34.0">1.34.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2588">source</a></span><h4class="code-header">pub fn <ahref="#method.escape_default"class="fn">escape_default</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.EscapeDefault.html"title="struct core::str::iter::EscapeDefault">EscapeDefault</a><'_></h4></section></summary><divclass="docblock"><p>Return an iterator that escapes each char in <code>self</code> with <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html#method.escape_default"title="method char::escape_default"><code>char::escape_default</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.escape_unicode"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.34.0">1.34.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2626">source</a></span><h4class="code-header">pub fn <ahref="#method.escape_unicode"class="fn">escape_unicode</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.EscapeUnicode.html"title="struct core::str::iter::EscapeUnicode">EscapeUnicode</a><'_></h4></section></summary><divclass="docblock"><p>Return an iterator that escapes each char in <code>self</code> with <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html#method.escape_unicode"title="method char::escape_unicode"><code>char::escape_unicode</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.replace"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/str.rs.html#269">source</a></span><h4class="code-header">pub fn <ahref="#method.replace"class="fn">replace</a><'a, P>(&'a self, from: P, to: &<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><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/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::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>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>s = <spanclass="string">"this is old"</span>;
<spanclass="macro">assert_eq!</span>(<spanclass="string">"this is new"</span>, s.replace(<spanclass="string">"old"</span>, <spanclass="string">"new"</span>));
<spanclass="macro">assert_eq!</span>(<spanclass="string">"than an old"</span>, s.replace(<spanclass="string">"is"</span>, <spanclass="string">"an"</span>));</code></pre></div>
<p>When the pattern doesn’t match, it returns this string slice as <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String"><code>String</code></a>:</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>s = <spanclass="string">"this is old"</span>;
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.replacen"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.16.0">1.16.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/str.rs.html#309">source</a></span><h4class="code-header">pub fn <ahref="#method.replacen"class="fn">replacen</a><'a, P>(&'a self, pat: P, to: &<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>, count: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><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/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::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>
<p>When the pattern doesn’t match, it returns this string slice as <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String"><code>String</code></a>:</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>s = <spanclass="string">"this is old"</span>;
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_lowercase"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.2.0">1.2.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/str.rs.html#366">source</a></span><h4class="code-header">pub fn <ahref="#method.to_lowercase"class="fn">to_lowercase</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></h4></section></summary><divclass="docblock"><p>Returns the lowercase equivalent of this string slice, as a new <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::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/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String"><code>String</code></a> instead of modifying the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_uppercase"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.2.0">1.2.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/str.rs.html#457">source</a></span><h4class="code-header">pub fn <ahref="#method.to_uppercase"class="fn">to_uppercase</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></h4></section></summary><divclass="docblock"><p>Returns the uppercase equivalent of this string slice, as a new <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::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/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String"><code>String</code></a> instead of modifying the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.repeat"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.16.0">1.16.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/str.rs.html#527">source</a></span><h4class="code-header">pub fn <ahref="#method.repeat"class="fn">repeat</a>(&self, n: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></h4></section></summary><divclass="docblock"><p>Creates a new <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String"><code>String</code></a> by repeating a string <code>n</code> times.</p>
<divclass="example-wrap should_panic"><ahref="#"class="tooltip"title="This example panics">ⓘ</a><preclass="rust rust-example-rendered"><code><spanclass="comment">// this will panic at runtime
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_ascii_uppercase"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/str.rs.html#557">source</a></span><h4class="code-header">pub fn <ahref="#method.to_ascii_uppercase"class="fn">to_ascii_uppercase</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></h4></section></summary><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/1.76.0/std/primitive.str.html#method.make_ascii_uppercase"title="method str::make_ascii_uppercase"><code>make_ascii_uppercase</code></a>.</p>
<p>To uppercase ASCII characters in addition to non-ASCII characters, use
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>s = <spanclass="string">"Grüße, Jürgen ❤"</span>;
<spanclass="macro">assert_eq!</span>(<spanclass="string">"GRüßE, JüRGEN ❤"</span>, s.to_ascii_uppercase());</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_ascii_lowercase"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/str.rs.html#589">source</a></span><h4class="code-header">pub fn <ahref="#method.to_ascii_lowercase"class="fn">to_ascii_lowercase</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></h4></section></summary><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/1.76.0/std/primitive.str.html#method.make_ascii_lowercase"title="method str::make_ascii_lowercase"><code>make_ascii_lowercase</code></a>.</p>
<p>To lowercase ASCII characters in addition to non-ASCII characters, use
</div></details></div><h2id="trait-implementations"class="section-header">Trait Implementations<ahref="#trait-implementations"class="anchor">§</a></h2><divid="trait-implementations-list"><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-AsRef%3C%5Bu8%5D%3E-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#127">source</a><ahref="#impl-AsRef%3C%5Bu8%5D%3E-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><[<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>]> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ref-1"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#129">source</a><ahref="#method.as_ref-1"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.AsRef.html#tymethod.as_ref"class="fn">as_ref</a>(&self) ->&[<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>] <ahref="#"class="tooltip"data-notable-ty="&[u8]">ⓘ</a></h4></section></summary><divclass='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-AsRef%3COsStr%3E-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#134">source</a><ahref="#impl-AsRef%3COsStr%3E-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><<aclass="struct"href="https://doc.rust-lang.org/1.76.0/std/ffi/os_str/struct.OsStr.html"title="struct std::ffi::os_str::OsStr">OsStr</a>> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ref"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#136">source</a><ahref="#method.as_ref"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.AsRef.html#tymethod.as_ref"class="fn">as_ref</a>(&self) ->&<aclass="struct"href="https://doc.rust-lang.org/1.76.0/std/ffi/os_str/struct.OsStr.html"title="struct std::ffi::os_str::OsStr">OsStr</a></h4></section></summary><divclass='docblock'>Converts this type into a shared reference of the (usually inferred) input type.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-AsRef%3CPath%3E-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#141">source</a><ahref="#impl-AsRef%3CPath%3E-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><<aclass="struct"href="https://doc.rust-lang.org/1.76.0/std/path/struct.Path.html"title="struct std::path::Path">Path</a>> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ref-2"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#143">source</a><ahref="#method.as_ref-2"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.AsRef.html#tymethod.as_ref"class="fn">as_ref</a>(&self) ->&<aclass="st
__H: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/hash/trait.Hasher.html"title="trait core::hash::Hasher">Hasher</a>,</div></h4></section></summary><divclass='docblock'>Feeds this value into the given <ahref="https://doc.rust-lang.org/1.76.0/core/hash/trait.Hasher.html"title="trait core::hash::Hasher"><code>Hasher</code></a>. <ahref="https://doc.rust-lang.org/1.76.0/core/hash/trait.Hash.html#tymethod.hash">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.hash_slice"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.3.0">1.3.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/hash/mod.rs.html#238-240">source</a></span><ahref="#method.hash_slice"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/hash/trait.Hash.html#method.hash_slice"class="fn">hash_slice</a><H>(data: &<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.slice.html">[Self]</a>, state: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&mut H</a>)<divclass="where">where
Self: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><divclass='docblock'>Feeds a slice of this type into the given <ahref="https://doc.rust-lang.org/1.76.0/core/hash/trait.Hasher.html"title="trait core::hash::Hasher"><code>Hasher</code></a>. <ahref="https://doc.rust-lang.org/1.76.0/core/hash/trait.Hash.html#method.hash_slice">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-IntoResettable%3CStr%3E-for-Option%3C%26str%3E"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/resettable.rs.html#133">source</a><ahref="#impl-IntoResettable%3CStr%3E-for-Option%3C%26str%3E"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="trait.IntoResettable.html"title="trait clap::builder::IntoResettable">IntoResettable</a><<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>> for <aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&'static <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.into_resettable"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/resettable.rs.html#134">source</a><ahref="#method.into_resettable"class="anchor">§</a><h4class="code-header">fn <ahref="trait.IntoResettable.html#tymethod.into_resettable"class="fn">into_resettable</a>(self) -><aclass="enum"href="enum.Resettable.html"title="enum clap::builder::Resettable">Resettable</a><<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>></h4></section></summary><divclass='docblock'>Convert to the intended resettable type</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Ord-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#5">source</a><ahref="#impl-Ord-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.Ord.html"title="trait core::cmp::Ord">Ord</a> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.cmp"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#5">source</a><ahref="#method.cmp"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.Ord.html#tymethod.cmp"class="fn">cmp</a>(&self, other: &<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/cmp/enum.Ordering.html"title="enum core::cmp::Ordering">Ordering</a></h4></section></summary><divclass='docblock'>This method returns an <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/enum.Ordering.html"title="enum core::cmp::Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.max"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.21.0">1.21.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#829-831">source</a></span><ahref="#method.max"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.Ord.html#method.max"class="fn">max</a>(self, other: Self) -> Self<divclass="where">where
Self: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><divclass='docblock'>Compares and returns the maximum of two values. <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.Ord.html#method.max">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.min"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.21.0">1.21.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#849-851">source</a></span><ahref="#method.min"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.Ord.html#method.min"class="fn">min</a>(self, other: Self) -> Self<divclass="where">where
Self: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><divclass='docblock'>Compares and returns the minimum of two values. <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.Ord.html#method.min">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.clamp"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.50.0">1.50.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#874-877">source</a></span><ahref="#method.clamp"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.Ord.html#method.clamp"class="fn">clamp</a>(self, min: Self, max: Self) -> Self<divclass="where">where
Self: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a> + <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialOrd.html"title="trait core::cmp::PartialOrd">PartialOrd</a>,</div></h4></section></summary><divclass='docblock'>Restrict a value to a certain interval. <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.Ord.html#method.clamp">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3C%26OsStr%3E-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#194">source</a><ahref="#impl-PartialEq%3C%26OsStr%3E-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a><&<aclass="struct"href="https://doc.rust-lang.org/1.76.0/std/ffi/os_str/struct.OsStr.html"title="struct std::ffi::os_str::OsStr">OsStr</a>> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-8"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#196">source</a><ahref="#method.eq-8"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: &&<aclass="struct"href="https://doc.rust-lang.org/1.76.0/std/ffi/os_str/struct.OsStr.html"title="struct std::ffi::os_str::OsStr">OsStr</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-8"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#242">source</a></span><ahref="#method.ne-8"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3C%26str%3E-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#168">source</a><ahref="#impl-PartialEq%3C%26str%3E-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a><&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#170">source</a><ahref="#method.eq"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: &&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#242">source</a></span><ahref="#method.ne"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CId%3E-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/util/id.rs.html#146">source</a><ahref="#impl-PartialEq%3CId%3E-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a><<aclass="struct"href="../struct.Id.html"title="struct clap::Id">Id</a>> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-2"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/util/id.rs.html#148">source</a><ahref="#method.eq-2"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: &<aclass="struct"href="../struct.Id.html"title="struct clap::Id">Id</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-2"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#242">source</a></span><ahref="#method.ne-2"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3COsStr%3E-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#181">source</a><ahref="#impl-PartialEq%3COsStr%3E-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a><<aclass="struct"href="https://doc.rust-lang.org/1.76.0/std/ffi/os_str/struct.OsStr.html"title="struct std::ffi::os_str::OsStr">OsStr</a>> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-4"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#183">source</a><ahref="#method.eq-4"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: &<aclass="struct"href="https://doc.rust-lang.org/1.76.0/std/ffi/os_str/struct.OsStr.html"title="struct std::ffi::os_str::OsStr">OsStr</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-4"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#242">source</a></span><ahref="#method.ne-4"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CStr%3E-for-%26OsStr"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#200">source</a><ahref="#impl-PartialEq%3CStr%3E-for-%26OsStr"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a><<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>> for &<aclass="struct"href="https://doc.rust-lang.org/1.76.0/std/ffi/os_str/struct.OsStr.html"title="struct std::ffi::os_str::OsStr">OsStr</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-9"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#202">source</a><ahref="#method.eq-9"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: &<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-9"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#242">source</a></span><ahref="#method.ne-9"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CStr%3E-for-%26str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#174">source</a><ahref="#impl-PartialEq%3CStr%3E-for-%26str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a><<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>> for &<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-11"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#176">source</a><ahref="#method.eq-11"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: &<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-11"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#242">source</a></span><ahref="#method.ne-11"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CStr%3E-for-Id"class="impl"><aclass="src rightside"href="../../src/clap_builder/util/id.rs.html#140">source</a><ahref="#impl-PartialEq%3CStr%3E-for-Id"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a><<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>> for <aclass="struct"href="../struct.Id.html"title="struct clap::Id">Id</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-3"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/util/id.rs.html#142">source</a><ahref="#method.eq-3"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: &<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-3"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#242">source</a></span><ahref="#method.ne-3"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CStr%3E-for-OsStr"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#187">source</a><ahref="#impl-PartialEq%3CStr%3E-for-OsStr"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a><<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>> for <aclass="struct"href="https://doc.rust-lang.org/1.76.0/std/ffi/os_str/struct.OsStr.html"title="struct std::ffi::os_str::OsStr">OsStr</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-6"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#189">source</a><ahref="#method.eq-6"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: &<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-6"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#242">source</a></span><ahref="#method.ne-6"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CStr%3E-for-str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#161">source</a><ahref="#impl-PartialEq%3CStr%3E-for-str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a><<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>> for <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-7"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#163">source</a><ahref="#method.eq-7"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: &<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-7"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#242">source</a></span><ahref="#method.ne-7"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3CString%3E-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#207">source</a><ahref="#impl-PartialEq%3CString%3E-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a><<aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-1"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#209">source</a><ahref="#method.eq-1"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: &<aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-1"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#242">source</a></span><ahref="#method.ne-1"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq%3Cstr%3E-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#155">source</a><ahref="#impl-PartialEq%3Cstr%3E-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-5"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#157">source</a><ahref="#method.eq-5"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: &<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-5"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#242">source</a></span><ahref="#method.ne-5"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialEq-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#5">source</a><ahref="#impl-PartialEq-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html"title="trait core::cmp::PartialEq">PartialEq</a> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq-10"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#5">source</a><ahref="#method.eq-10"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#tymethod.eq"class="fn">eq</a>(&self, other: &<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne-10"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#242">source</a></span><ahref="#method.ne-10"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-PartialOrd-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#5">source</a><ahref="#impl-PartialOrd-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialOrd.html"title="trait core::cmp::PartialOrd">PartialOrd</a> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.partial_cmp"class="method trait-impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#5">source</a><ahref="#method.partial_cmp"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp"class="fn">partial_cmp</a>(&self, other: &<aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/cmp/enum.Ordering.html"title="enum core::cmp::Ordering">Ordering</a>></h4></section></summary><divclass='docblock'>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.lt"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#1125">source</a></span><ahref="#method.lt"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialOrd.html#method.lt"class="fn">lt</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.le"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#1142">source</a></span><ahref="#method.le"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialOrd.html#method.le"class="fn">le</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code>
operator. <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialOrd.html#method.le">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.gt"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#1158">source</a></span><ahref="#method.gt"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialOrd.html#method.gt"class="fn">gt</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ge"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/cmp.rs.html#1175">source</a></span><ahref="#method.ge"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialOrd.html#method.ge"class="fn">ge</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code>
operator. <ahref="https://doc.rust-lang.org/1.76.0/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></div></details></div></details><sectionid="impl-Eq-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#5">source</a><ahref="#impl-Eq-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/cmp/trait.Eq.html"title="trait core::cmp::Eq">Eq</a> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section><sectionid="impl-StructuralEq-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#5">source</a><ahref="#impl-StructuralEq-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.StructuralEq.html"title="trait core::marker::StructuralEq">StructuralEq</a> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section><sectionid="impl-StructuralPartialEq-for-Str"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/str.rs.html#5">source</a><ahref="#impl-StructuralPartialEq-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.StructuralPartialEq.html"title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></div><h2id="synthetic-implementations"class="section-header">Auto Trait Implementations<ahref="#synthetic-implementations"class="anchor">§</a></h2><divid="synthetic-implementations-list"><sectionid="impl-RefUnwindSafe-for-Str"class="impl"><ahref="#impl-RefUnwindSafe-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/panic/unwind_safe/trait.RefUnwindSafe.html"title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section><sectionid="impl-Send-for-Str"class="impl"><ahref="#impl-Send-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Send.html"title="trait core::marker::Send">Send</a> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section><sectionid="impl-Sync-for-Str"class="impl"><ahref="#impl-Sync-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sync.html"title="trait core::marker::Sync">Sync</a> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section><sectionid="impl-Unpin-for-Str"class="impl"><ahref="#impl-Unpin-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Unpin.html"title="trait core::marker::Unpin">Unpin</a> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section><sectionid="impl-UnwindSafe-for-Str"class="impl"><ahref="#impl-UnwindSafe-for-Str"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/panic/unwind_safe/trait.UnwindSafe.html"title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <aclass="struct"href="struct.Str.html"title="struct clap::builder::Str">Str</a></h3></section></div><h2id="blanket-implementations"class="section-header">Blanket Implementations<ahref="#blanket-implementations"class="anchor">§</a></h2><divid="blanket-implementations-list"><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Any-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/any.rs.html#140">source</a><ahref="#impl-Any-for-T"class="anchor">§</a><h3class="code-header">impl<T
T: 'static + ?<aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.type_id"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/any.rs.html#141">source</a><ahref="#method.type_id"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/any/trait.Any.html#tymethod.type_id"class="fn">type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/any/struct.TypeId.html"title="struct core::any::TypeId">TypeId</a></h4></section></summary><divclass='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <ahref="https://doc.rust-lang.org/1.76.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Borrow%3CT%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/borrow.rs.html#208">source</a><ahref="#impl-Borrow%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/borrow/trait.Borrow.html"title="trait core::borrow::Borrow">Borrow</a><T> for T<divclass="where">where
T: ?<aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.borrow-1"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/borrow.rs.html#210">source</a><ahref="#method.borrow-1"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/borrow/trait.Borrow.html#tymethod.borrow"class="fn">borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&T</a></h4></section></summary><divclass='docblock'>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.76.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-BorrowMut%3CT%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/borrow.rs.html#216">source</a><ahref="#impl-BorrowMut%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/borrow/trait.BorrowMut.html"title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<divclass="where">where
T: ?<aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.borrow_mut"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/borrow.rs.html#217">source</a><ahref="#method.borrow_mut"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut"class="fn">borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&mut T</a></h4></section></summary><divclass='docblock'>Mutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.76.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-From%3CT%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#763">source</a><ahref="#impl-From%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for T</h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.from-8"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#766">source</a><ahref="#method.from-8"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.From.html#tymethod.from"class="fn">from</a>(t: T) -> T</h4></section></summary><divclass="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Into%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#747-749">source</a><ahref="#impl-Into%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><U> for T<divclass="where">where
<p>That is, this conversion is whatever the implementation of
<code><ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-IntoResettable%3CId%3E-for-I"class="impl"><aclass="src rightside"href="../../src/clap_builder/builder/resettable.rs.html#208">source</a><ahref="#impl-IntoResettable%3CId%3E-for-I"class="anchor">§</a><h3class="code-header">impl<I><aclass="trait"href="trait.IntoResettable.html"title="trait clap::builder::IntoResettable">IntoResettable</a><<aclass="struct"href="../struct.Id.html"title="struct clap::Id">Id</a>> for I<divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Owned"class="associatedtype trait-impl"><ahref="#associatedtype.Owned"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.76.0/alloc/borrow/trait.ToOwned.html#associatedtype.Owned"class="associatedtype">Owned</a> = T</h4></section></summary><divclass='docblock'>The resulting type after obtaining ownership.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_owned"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/alloc/borrow.rs.html#88">source</a><ahref="#method.to_owned"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned"class="fn">to_owned</a>(&self) -> T</h4></section></summary><divclass='docblock'>Creates owned data from borrowed data, usually by cloning. <ahref="https://doc.rust-lang.org/1.76.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.clone_into"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/alloc/borrow.rs.html#92">source</a><ahref="#method.clone_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/alloc/borrow/trait.ToOwned.html#method.clone_into"class="fn">clone_into</a>(&self, target: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&mut T</a>)</h4></section></summary><divclass='docblock'>Uses borrowed data to replace owned data, usually by cloning. <ahref="https://doc.rust-lang.org/1.76.0/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-ToString-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/alloc/string.rs.html#2600">source</a><ahref="#impl-ToString-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.76.0/alloc/string/trait.ToString.html"title="trait alloc::string::ToString">ToString</a> for T<divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Display.html"title="trait core::fmt::Display">Display</a> + ?<aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_string"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/alloc/string.rs.html#2606">source</a><ahref="#method.to_string"class="anchor">§</a><h4class="code-header">default fn <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/trait.ToString.html#tymethod.to_string"class="fn">to_string</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></h4></section></summary><divclass='docblock'>Converts the given value to a <code>String</code>. <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryFrom%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#803-805">source</a><ahref="#impl-TryFrom%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T<divclass="where">where
U: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error"class="associatedtype trait-impl"><ahref="#associatedtype.Error"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_from"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#810">source</a><ahref="#method.try_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#tymethod.try_from"class="fn">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryInto%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#788-790">source</a><ahref="#impl-TryInto%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T<divclass="where">where
U: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error-1"class="associatedtype trait-impl"><ahref="#associatedtype.Error-1"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_into"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#795">source</a><ahref="#method.try_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryInto.html#tymethod.try_into"class="fn">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details></div><scripttype="text/json"id="notable-traits-data">{"&[u8]":"<h3>Notable traits for <code>&[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.76.0/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.76.0/std/primitive.u8.html\">u8</a>]</div>"}</script></section></div></main></body></html>