我想找出'B'在字符串'ABCDEF'中的位置,但为什么每次都返回0高手帮看看,谢了.ShowMessage(IntToStr(POS('ABCDEF','B')));

解决方案 »

  1.   

    写反了
      ShowMessage(IntToStr(POS('B','ABCDEF')));
      

  2.   

    function Pos(Substr: string; S: string): Integer;
      

  3.   

    呵呵,好好看看pos的函数介绍
      

  4.   

    ShowMessage(IntToStr(POS('B','ABCDEF')));
      

  5.   

    ShowMessage(IntToStr(POS('B','ABCDEF')));接分啊:)
      

  6.   

    最好的老师是delphi自带的帮助啊。
      

  7.   

    function Pos(Substr: string; S: string): Integer;写反了
      ShowMessage(IntToStr(POS('B','ABCDEF')));
      

  8.   

    来的太晚了.这个的写法应该是 
    pos(子字符串,目标字符串)