[#bsl-getline-08] = xref:bsl.adoc[bsl]::getline :relfileprefix: ../ :mrdocs: `getline` overloads == Synopses Declared in `<bslstl_string.h>` Replace the contents of the specified `str` string by extracting characters from the specified `is` stream until a newline character (`is.widen(' ')`) is extracted, and return `is`. The newline character is removed from the input stream but is not appended to `str`. If an `eof` is detected before the newline, then the characters up to the `eof` are put into `str` and `is.eof()` becomes true. If `is.good()` is false on entry, then do nothing, otherwise if no characters are extracted (e.g., because because the stream is at eof), `str` will become empty and `is.fail()` will become true. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> std::basic_istream<CHAR_TYPE, CHAR_TRAITS>& xref:bsl/getline-0a.adoc[getline]( std::basic_istream<CHAR_TYPE, CHAR_TRAITS>& is, xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]& str); ---- [.small]#xref:bsl/getline-0a.adoc[_» more..._]# Replace the contents of the specified `str` string by extracting characters from the specified `is` stream until the specified `delim` character is extracted, and return `is`. The `delim` character is removed from the input stream but is not appended to `str`. If an `eof` is detected before `delim`, then the characters up to the `eof` are put into `str` and `is.eof()` becomes true. If `is.good()` is false on entry, then do nothing, otherwise if no characters are extracted (e.g., because because the stream is at eof), `str` will become empty and `is.fail()` will become true. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> std::basic_istream<CHAR_TYPE, CHAR_TRAITS>& xref:bsl/getline-04.adoc[getline]( std::basic_istream<CHAR_TYPE, CHAR_TRAITS>& is, xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]& str, CHAR_TYPE delim); ---- [.small]#xref:bsl/getline-04.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#