[#bsl-operator_lshift-05f]
= xref:bsl.adoc[bsl]::operator&lt;&lt;
:relfileprefix: ../
:mrdocs:

Write the string specified by `str` into the output stream specified by `os`, and return `os`&period; If the string is shorter than `os&period;width()`, then it is padded to `os&period;width()` with the current `os&period;fill()` character&period; The padding, if any, is output after the string (on the right) if `os&period;flags() &verbar; ios&colon;&colon;left` is non&hyphen;zero and before the string otherwise&period; This function will do nothing unless `os&period;good()` is true on entry&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;ostream&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS&gt;&
operator&lt;&lt;(
    std::basic&lowbar;ostream&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS&gt;& os,
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;] const& str);
----


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