Rav*_*aju 9 c++ string stl
在STL中,当我这样做时s.find(""),它返回0而s.find_first_of("")返回-1(npos).造成这种差异的原因是什么?
s.find("")
s.find_first_of("")
ric*_*ici 20
s.find(t)发现字符串的第一个发生t在s.如果t为空,则该事件发生在s,并s.find(t)返回0.
s.find(t)
t
s
s.find_first_of(t)发现的第一个匹配的字符中的一个在t.如果t是空字符串,则没有字符t,因此找不到任何匹配项,并且find_first_of将返回npos.
s.find_first_of(t)
find_first_of
npos
生活在想法上.
归档时间:
10 年,6 月 前
查看次数:
6573 次
最近记录: