[#bsl-operator_rshift-02]
= xref:bsl.adoc[bsl]::operator&gt;&gt;
:relfileprefix: ../
:mrdocs:

Replace the contents of the specified `str` string with a word read from the specified `is` input stream, and return `is`&period; The word begins at the first non&hyphen;whitespace character on the input stream and ends when another whitespace character (or eof) is found&period; The trailing whitespace character is left on the input stream&period; If `is&period;good()` is not true on entry or if eof is found before any non&hyphen;whitespace characters, then `str` is unchanged and `is&period;fail()` is becomes true&period; If eof is detected after some characters have been read into `str`, then `is&period;eof()` becomes true, but `is&period;fail()` does not&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;string&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR&gt;
std::basic&lowbar;istream&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS&gt;&
operator&gt;&gt;(
    std::basic&lowbar;istream&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS&gt;& is,
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]& str);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
