Boost C++ 库

……世界上最受推崇和设计精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu,《C++ 编码规范

函数 ireplace_all_copy - Boost C++ 函数库
PrevUpHomeNext

函数 ireplace_all_copy

boost::algorithm::ireplace_all_copy — 全局替换算法(不区分大小写)

提要

// In header: <boost/algorithm/string/replace.hpp>


template<typename OutputIteratorT, typename Range1T, typename Range2T, 
         typename Range3T> 
  OutputIteratorT 
  ireplace_all_copy(OutputIteratorT Output, const Range1T & Input, 
                    const Range2T & Search, const Range3T & Format, 
                    const std::locale & Loc = std::locale());
template<typename SequenceT, typename Range1T, typename Range2T> 
  SequenceT ireplace_all_copy(const SequenceT & Input, const Range1T & Search, 
                              const Range2T & Format, 
                              const std::locale & Loc = std::locale());

描述

将输入中所有出现的搜索字符串替换为格式字符串。结果是输入的修改副本。它作为序列返回或复制到输出迭代器。搜索不区分大小写。

[Note] 注意

此函数的第二个变体提供强异常安全保证。

参数

输出:

一个输出迭代器,结果将被复制到该迭代器。

输入

一个输入字符串

搜索

要搜索的子字符串

Format

替换字符串

位置

用于不区分大小写比较的区域设置

返回

一个输出迭代器,指向最后一个插入字符之后的位置,或输入的修改副本。


PrevUpHomeNext