计算字符串中特定字符的个数

字体大小: 中小 标准 ->行高大小: 标准
我要从‘080012345678EBEB0000EBEB998877’中返回‘EB’的个数
-----------------------------------------------------
Str:='080012345678EBEB0000EBEB998877';
Count:=0;
while Pos('EB',Str)<>0 do
begin
  Str:=Copy(Str,Pos('EB',Str)+1,Length(Str,Pos('EB',Str)));
  Inc(Count);
end;

Count即为所求结果

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/67977.html