[#bsl-getline-08]
= xref:bsl.adoc[bsl]::getline
:relfileprefix: ../
:mrdocs:

Read characters from a stream into a string&period;

== Synopses

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

Read characters from a stream into a string&period;


[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;&
xref:bsl/getline-0a.adoc[getline](
    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]#xref:bsl/getline-0a.adoc[_» more&period;&period;&period;_]#

Read characters from a stream into a string&period;


[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;&
xref:bsl/getline-04.adoc[getline](
    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,
    CHAR&lowbar;TYPE delim);
----

[.small]#xref:bsl/getline-04.adoc[_» more&period;&period;&period;_]#

== Return Value

reference to the input stream `is`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *is*
| input stream
| *str*
| string to read into or parse
| *delim*
| delimiter character ending the extraction
|===


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