Boost C++ 库

...世界上最受尊敬和精心设计的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu, C++ 编码标准

PrevUpHomeNext

函数模板 erase_tail

boost::algorithm::erase_tail — 删除尾部算法。

概要

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


template<typename SequenceT> void erase_tail(SequenceT & Input, int N);

描述

从输入中移除尾部。尾部是给定大小的序列的后缀。如果序列短于要求的长度,则整个字符串被认为是尾部。输入序列将就地修改。

参数

输入

输入字符串

N

尾部的长度。对于 N>=0,最多提取 N 个字符。对于 N<0,提取 size(Input)-|N| 个字符。


PrevUpHomeNext