“100套餐类”,怎样取出以上字符串中的数字?
100并不是一个固定的值,而是用户自己定义的,有可能是20、30、50、200...

解决方案 »

  1.   

    从字符串中取出数字
    type
      TCharSet = set of Char;function StripNonConforming(const S: string;
      const ValidChars: TCharSet): string;
    var
      DestI: Integer;
      SourceI: Integer;
    begin
      SetLength(Result, Length(S));
      DestI := 0;
      for SourceI := 1 to Length(S) do
        if S[SourceI] in ValidChars then
        begin
          Inc(DestI);
          Result[DestI] := S[SourceI]
        end;
      SetLength(Result, DestI)
    end;function StripNonNumeric(const S: string): string;
    begin
      Result := StripNonConforming(S, ['0'..'9'])
    end;
      

  2.   

    嘿,多谢tiexinliu(铁心刘) 
    我再请教一问题,就是大容量的数据如何分批取出,比如说第一次取出100条,第二次取出101-200条??数据库用sql server2000