ogramlisting">std::string data;
std::string n = boost::asio::read_until(s,
    boost::asio::dynamic_buffer(data), "\r\n");
std::string line = data.substr(0, n);
data.erase(0, n);
</pre>
<p>
          After the <code class="computeroutput">read_until</code> operation completes successfully, the
          string <code class="computeroutput">data</code> contains the delimiter:
        </p>
<pre class="programlisting">{ 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
</pre>
<p>
          The call to <code class