gpt4 book ai didi

c++ - 在 C++ 字符串中替换的最佳方法是什么?

转载 作者:行者123 更新时间:2023-11-30 04:33:25 25 4
gpt4 key购买 nike

我想知道在 C++ 中替换字符串中出现的所有 的最佳和最快的方法是什么?

有什么方法不需要循环替换函数吗?

最佳答案

检查提升:boost::algorithm::replace_all 和 boost::algorithm::replace_all_复制

我仍然不知道它是否比循环替换函数更快。你必须做一些测试。

http://www.boost.org/doc/libs/1_47_0/doc/html/string_algo/reference.html#header.boost.algorithm.string.replace_hpp

关于c++ - 在 C++ 字符串中替换的最佳方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6881939/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com