Boost C++ 库

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

函数模板 ifind_nth - Boost C++ 函数库
PrevUpHomeNext

函数模板 ifind_nth

boost::algorithm::ifind_nth — 查找第 n 个算法(不区分大小写)。

提要

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


template<typename Range1T, typename Range2T> 
  iterator_range< typename range_iterator< Range1T >::type > 
  ifind_nth(Range1T & Input, const Range2T & Search, int Nth, 
            const std::locale & Loc = std::locale());

描述

在输入中搜索子字符串的第 n 个(从零开始索引)出现。搜索不区分大小写。

[Note] 注意

此函数提供强异常安全保证

参数

输入

要搜索的字符串。

搜索

要搜索的子字符串。

第 N 个

要查找匹配项的索引(从零开始索引)。对于负的 N,匹配项将从字符串的末尾开始计数。

位置

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

返回

一个 iterator_range,用于限定匹配项。返回的迭代器是 Range1T::iteratorRange1T::const_iterator,具体取决于输入参数的 const 性质。


PrevUpHomeNext