当前位置: 首页>>代码示例>>C++>>正文


C++ str::end方法代码示例

本文整理汇总了C++中str::end方法的典型用法代码示例。如果您正苦于以下问题:C++ str::end方法的具体用法?C++ str::end怎么用?C++ str::end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在str的用法示例。


在下文中一共展示了str::end方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: disp

void disp(str v)
{ for (sit it=v.begin(); it!=v.end(); it++)
    cout << *it << endl;
  cout << endl;
}
开发者ID:hanhonglei,项目名称:Course_OOPGames,代码行数:5,代码来源:10_2.cpp

示例2: count

/*************************************************
S.count(sub[, start[, end]]) -> uint
	Return the number of non-overlapping occurrences of substring sub in
	string S[start:end].  Optional arguments start and end are interpreted
	as in slice notation.
*************************************************/
uint str::count(const str& sub, int start, int end) {
	return ::count((start<0?s.end():s.begin())+start, (end<=0?s.end():s.begin())+end, sub.begin(), sub.end());
}
开发者ID:jadesoul,项目名称:libsoul,代码行数:9,代码来源:str.cpp

示例3: endswith

/*************************************************
S.endswith(suffix[, start[, end]]) -> bool
	Return True if S ends with the specified suffix, False otherwise.
	With optional start, test S beginning at that position.
	With optional end, stop comparing S at that position.
	suffix can also be a tuple of strings to try.
*************************************************/
bool str::endswith(const str& prefix, int start, int end) const {
	return ::endswith((start<0?s.end():s.begin())+start, (end<=0?s.end():s.begin())+end, prefix.begin(), prefix.end());
}
开发者ID:jadesoul,项目名称:libsoul,代码行数:10,代码来源:str.cpp

示例4: find

/*************************************************
S.find(sub [,start [,end]]) -> int
	Search from left to right.
	Return the lowest index in S where substring sub is found,
	such that sub is contained within s[start:end].  Optional
	arguments start and end are interpreted as in slice notation.
	Return -1 on failure.
*************************************************/
int str::find(const str& sub, int start, int end) const {
	citerator a=(start<0?s.end():s.begin())+start, b=(end<=0?s.end():s.begin())+end;
	if (a>=b) return -1;
	citerator c=std::search(a, b, sub.begin(), sub.end());
	return (c==b)?-1:c-a;
}
开发者ID:jadesoul,项目名称:libsoul,代码行数:14,代码来源:str.cpp


注:本文中的str::end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。