[#BloombergLP-bslx-TestInStream-getString]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslx.adoc[bslx]::xref:BloombergLP/bslx/TestInStream.adoc[TestInStream]::getString
:relfileprefix: ../../../
:mrdocs:

Consume a string value from this stream&period;

== Synopsis

Declared in `&lt;bslx&lowbar;testinstream&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslx/TestInStream.adoc[TestInStream]&
getString(xref:bsl/string.adoc[bsl::string]& variable);
----

== Description

If required, throw a `TestInStreamException` (see `throwExceptionIfInputLimitExhausted`)&semi; otherwise, consume a string from this input stream, assign that value to the specified `variable`, update the cursor location, and return a reference to this stream&period; If this stream is initially invalid, this operation has no effect&period; If this function otherwise fails to extract a valid value, this stream is marked invalid and the value of `variable` is undefined&period; The string must be prefaced by a non&hyphen;negative integer indicating the number of characters composing the string&period; The behavior is undefined unless the length indicator is non&hyphen;negative&period;

== Return Value

a reference to this stream

== Parameters

[cols="1,4"]
|===
| Name| Description
| *variable*
| destination for the extracted string
|===


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