关于查找字符的问题!?????????????????????????????????????????????????????????????????????
关于查找字符的问题!?????????????????????????????????????????????????????????????????????
例如一个字符串 'aa,bb,cc,kk,qq, ..................................'
请问怎样统计出","出现的数量??????????????
请各位高手给出详细的代码,感激万分!!!!!!!!!!!!!!!!!!!!!!!
问题点数:10、回复次数:1Top
1 楼lihao_ningxia(耗子)回复于 2003-09-04 13:50:25 得分 10
function countchar(str:string,ch:char):integer;
var
count:integer;
i:integer;
begin
count:=0;
for i:=1 to str.length do
begin
if str[i]=ch then
count:=count+1;
end;
result:=count;
end;
随手,没有调试,你自己调试一下Top




