分享一个函数GetStr

Function  GetStr(STR_Source,STR_Start,STR_End:String):STring;
 Var
   I:Integer;
   S:String;
 begin
    for I := Pos(STR_Start,STR_Source)+Length(STR_Start) to Length(STR_Source) do
        begin
          if STR_Source[i]=STR_End then Break;
             S:=S+STR_Source[i];
        end;
        Result:=S;
  end;

我写一个函数主要是用于网页采集。

  STR_Source:采集的内容,如:“账户余额:<b class="forg">2609</b> ”

  STR_Start:所要采集字符的前一个或几个字符,如“账户余额:<b class="forg">”

  STR_End:所要采集字符的后一个字符,如:“<”

最后的返回结果,如“2609”

posted @ 2013-05-25 15:11  似水@流年  阅读(1050)  评论(0编辑  收藏  举报
悠悠记得当天笑 仿佛入迷 又带一点惘 种种喜悦 令人为你鼓掌 眉飞色舞千千样 你是个妙人 是个少年狂