zoukankan      html  css  js  c++  java
  • (原创)将字符串中所有非空的连续字符串列出来

    procedure TForm1.DelimitStr(Str: String; var DeskString: TStrings);
    var
      Temp: string;
      I, J, NoNull: Integer;
    begin
      NoNull := 0;
      Temp := Str;
      if Str = '' then
        Exit;

      while NoNull <> Length(Temp) do
      begin
        NoNull := 0;
        for I := 1 to Length(Temp) do
        begin
          if (Ord(Temp[I]) = 32) then
          begin
            DeskString.Add(Copy(Temp, 1, I - 1));
            Temp := Trim(Copy(Temp, I, Length(Temp)));
            Break;
          end
          else
            Inc(NoNull);
          if NoNull = Length(Temp) then
          begin
            DeskString.Add(Temp);
            Break;
          end;
        end;
      end;


    end;

  • 相关阅读:
    高级查询及分页总结
    SQL编程
    线程同步
    创建和启动线程
    错题集04
    错题集03
    错题集02
    错题集
    新闻发布系统
    九大内置对象
  • 原文地址:https://www.cnblogs.com/chengxin1982/p/1370959.html
Copyright © 2011-2022 走看看