打印本文 打印本文 关闭窗口 关闭窗口
将指定字符串后面的0字符截去[原创]
作者:武汉SEO闵涛  文章来源:敏韬网  点击数668  更新时间:2009/4/23 18:27:27  文章录入:mintao  责任编辑:mintao
{-------------------------------------------------------------------------------
  过程名:    TForm1.RTrimZero
  作者:      王洪生(Kevin)
  日期:      2004.12.22
  参数:      const AValue: string
  返回值:    string
  功能:      将指定字符串后面的0字符截去
-------------------------------------------------------------------------------}
function TForm1.RTrimZero(const AValue: string): string;
var
  nLen : Integer;
  i    : Integer;
  strTemp: string;
begin
  if (AValue = '''''''') then Result := '''''''';
  nLen := Length(AValue);
  strTemp := AValue;
  for i:= nLen downto 1 do
  begin
    if (AValue[i] = ''''0'''') then
      strTemp[i] := '''' ''''
    else
      Break;
  end;
  Result := strTemp;
end;

打印本文 打印本文 关闭窗口 关闭窗口