例如我这有一组数据
26.10.1.2.0.14.14.14.7.d0.6.0
想取得1.2.0.14.14
但是1.2.0.14.14会变得长度不固定(1.2.0.8.8)
我琢磨着还是用点做标记
第二点到第7个点之间的数据。
求帮助

解决方案 »

  1.   

    function Get(s:string):string;
    var
      i, count,start,over:integer;
    begin
      count:=0;
      for i:= 1 to length(s) do
        if s[i]='.' then
        begin
          inc(count);
          if count=2 then start:=i;
          if count=7 then begin over:=i; break; end;
        end;
      result := copy(s,start+1, over-start-1);
    end;调用:s:=Get('26.10.1.2.0.14.14.14.7.d0.6.0');
      

  2.   

    谢谢 HSFZXJY!
    非常好用!
    我这就结贴了!
    同样谢谢大家!