<legend id='RMQ36'><style id='RMQ36'><dir id='RMQ36'><q id='RMQ36'></q></dir></style></legend>
      <tfoot id='RMQ36'></tfoot>
    1. <i id='RMQ36'><tr id='RMQ36'><dt id='RMQ36'><q id='RMQ36'><span id='RMQ36'><b id='RMQ36'><form id='RMQ36'><ins id='RMQ36'></ins><ul id='RMQ36'></ul><sub id='RMQ36'></sub></form><legend id='RMQ36'></legend><bdo id='RMQ36'><pre id='RMQ36'><center id='RMQ36'></center></pre></bdo></b><th id='RMQ36'></th></span></q></dt></tr></i><div id='RMQ36'><tfoot id='RMQ36'></tfoot><dl id='RMQ36'><fieldset id='RMQ36'></fieldset></dl></div>

        • <bdo id='RMQ36'></bdo><ul id='RMQ36'></ul>

        <small id='RMQ36'></small><noframes id='RMQ36'>

      1. C++ 等效于 StringBuffer/StringBuilder?

        时间:2024-05-12

      2. <small id='PEMCi'></small><noframes id='PEMCi'>

        <legend id='PEMCi'><style id='PEMCi'><dir id='PEMCi'><q id='PEMCi'></q></dir></style></legend>
        <i id='PEMCi'><tr id='PEMCi'><dt id='PEMCi'><q id='PEMCi'><span id='PEMCi'><b id='PEMCi'><form id='PEMCi'><ins id='PEMCi'></ins><ul id='PEMCi'></ul><sub id='PEMCi'></sub></form><legend id='PEMCi'></legend><bdo id='PEMCi'><pre id='PEMCi'><center id='PEMCi'></center></pre></bdo></b><th id='PEMCi'></th></span></q></dt></tr></i><div id='PEMCi'><tfoot id='PEMCi'></tfoot><dl id='PEMCi'><fieldset id='PEMCi'></fieldset></dl></div>

              <bdo id='PEMCi'></bdo><ul id='PEMCi'></ul>

              1. <tfoot id='PEMCi'></tfoot>
                  <tbody id='PEMCi'></tbody>
                  本文介绍了C++ 等效于 StringBuffer/StringBuilder?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  是否有 C++ 标准模板库类提供高效的字符串连接功能,类似于 C# 的 StringBuilder 或 Java 的 字符串缓冲区?

                  Is there a C++ Standard Template Library class that provides efficient string concatenation functionality, similar to C#'s StringBuilder or Java's StringBuffer?

                  推荐答案

                  C++ 的方式是使用 std::stringstream 或只是简单的字符串连接.C++ 字符串是可变的,因此连接的性能考虑不太重要.

                  The C++ way would be to use std::stringstream or just plain string concatenations. C++ strings are mutable so the performance considerations of concatenation are less of a concern.

                  关于格式化,您可以对流进行所有相同的格式化,但是 在一种不同的方式,类似于 cout.或者你可以使用一个强类型的函子来封装它并提供一个类似 String.Format 的接口,例如boost::format

                  with regards to formatting, you can do all the same formatting on a stream, but in a different way, similar to cout. or you can use a strongly typed functor which encapsulates this and provides a String.Format like interface e.g. boost::format

                  这篇关于C++ 等效于 StringBuffer/StringBuilder?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:将类型添加到 std 命名空间 下一篇:vector::at 与 vector::operator[]

                  相关文章

                  • <bdo id='6laYa'></bdo><ul id='6laYa'></ul>

                    <legend id='6laYa'><style id='6laYa'><dir id='6laYa'><q id='6laYa'></q></dir></style></legend>
                    1. <small id='6laYa'></small><noframes id='6laYa'>

                      <i id='6laYa'><tr id='6laYa'><dt id='6laYa'><q id='6laYa'><span id='6laYa'><b id='6laYa'><form id='6laYa'><ins id='6laYa'></ins><ul id='6laYa'></ul><sub id='6laYa'></sub></form><legend id='6laYa'></legend><bdo id='6laYa'><pre id='6laYa'><center id='6laYa'></center></pre></bdo></b><th id='6laYa'></th></span></q></dt></tr></i><div id='6laYa'><tfoot id='6laYa'></tfoot><dl id='6laYa'><fieldset id='6laYa'></fieldset></dl></div>
                      <tfoot id='6laYa'></tfoot>