zoukankan      html  css  js  c++  java
  • delphi 过滤开头 结尾 全部 空格的函数

    function TrimAnsi(const S: AnsiString): Ansistring;
    var
      I, L: Integer;
    begin
      L := Length(S);
      I := 1;
      while (I <= L) and (S[I] <= ' ') do Inc(I);
      if I > L then Result := '' else
      begin
        while S[L] <= ' ' do Dec(L);
        Result := Copy(S, I, L - I + 1);
      end;
    end;
    
    function TrimLeftAnsi(const S: AnsiString): AnsiString;
    var
      I, L: Integer;
    begin
      L := Length(S);
      I := 1;
      while (I <= L) and (S[I] <= ' ') do Inc(I);
      Result := Copy(S, I, Maxint);
    end;
    
    function TrimRightAnsi(const S: Ansistring): AnsiString;
    var
      I: Integer;
    begin
      I := Length(S);
      while (I > 0) and (S[I] <= ' ') do Dec(I);
      Result := Copy(S, 1, I);
    end;
  • 相关阅读:
    技巧使用
    一些常用的安装包可选安装组件
    php ob_flush与flush的作用
    HTML5 localStorage本地存储
    php clearstatcache
    iconv
    Mysql数字类型转换函数
    POJ
    POJ
    POJ
  • 原文地址:https://www.cnblogs.com/westsoft/p/8449598.html
Copyright © 2011-2022 走看看