请教各位大虾:有没有一个函数可以返回一个子字符串在主字符串的位置或怎样写能得到这样的结果,谢谢呀(急用)!!!

解决方案 »

  1.   

    用  pos(主字符串,子串):integer;
    返回一个整形数值  这个植就是子串的位置
      

  2.   

    aiirii(ari)?
    pos函数支持子串吗?我想的相对复杂;
    先将子串用一个特殊字符代替;然后用pos;
      

  3.   

    自己写一个函数判断吧;
    var I: integer;
    begin
     while ansicontainstext(substr,str) do
     begin
       inc(I);
       str := ansireplacetext(str,substr,'');
     end;
    end;
      

  4.   

    To 47522341(睡到8:30) 
    ansicontainstext(substr,str);
    str := ansireplacetext(str,substr,'') 这两句是什么意思,能不能给点中文注释,谢谢!!!
      

  5.   

    用循环  while pos()<>0 do
                i:=i+1 
    来统计