[#bsl-operator_rshift-02] = xref:bsl.adoc[bsl]::operator>> :relfileprefix: ../ :mrdocs: Replace the contents of the specified `str` string with a word read from the specified `is` input stream, and return `is`. The word begins at the first non‐whitespace character on the input stream and ends when another whitespace character (or eof) is found. The trailing whitespace character is left on the input stream. If `is.good()` is not true on entry or if eof is found before any non‐whitespace characters, then `str` is unchanged and `is.fail()` is becomes true. If eof is detected after some characters have been read into `str`, then `is.eof()` becomes true, but `is.fail()` does not. == Synopsis Declared in `<bslstl_string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> std::basic_istream<CHAR_TYPE, CHAR_TRAITS>& operator>>( std::basic_istream<CHAR_TYPE, CHAR_TRAITS>& is, xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]& str); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#