取第3个'|'的位置,如取'mm|nn|xx|ddfa|hahsdf|eof',如何取第3个'|'在字符串中的位置(排行老几)?

解决方案 »

  1.   

    用这个函数,构造吧
    Returns the index value of a substring.UnitStrUtilsCategorystring handling routinesDelphi syntax:function PosEx(const SubStr, S: string; Offset: Cardinal = 1): Integer;C++ syntax:extern PACKAGE int __fastcall PosEx(const AnsiString SubStr, const AnsiString S, unsigned Offset = 1);DescriptionPosEx returns the index of SubStr in S, beginning the search at Offset. If Offset is 1 (default), PosEx is equivalent to Pos.PosEx returns 0 if SubStr is not found, if Offset is greater than the length of S, or if Offset is less than 1.
      

  2.   

    SubStr是子串,要是那个长字符串,Offset是从第几个位置开始找
      

  3.   

    o 哦 ,我 的是D5的,找不着.看来只能自己编写函数了。thank you all the s。ame.