deprecated 关键字用来说明一个函数已经被弃用了,只是为了向下兼容而保留该函数。你继续使用也并没有“错”,就好像API 函数 WinExec 也是输入被弃用的,只是为了向下兼容而保留着它。
该单元下有对应unicode版本 LeftStr 函数重载版本
uses WideStrUtils;function LeftStr(const AText: WideString; const ACount: Integer): WideString; overload;
begin
  Result := Copy(AText, 1, ACount);
end;

解决方案 »

  1.   

    应该是 StrUtils 单元
    // ansi
    function LeftStr(const AText: AnsiString; const ACount: Integer): AnsiString; overload;
    begin
      Result := Copy(AText, 1, ACount);
    end;// unicode
    function LeftStr(const AText: WideString; const ACount: Integer): WideString; overload;
    begin
      Result := Copy(AText, 1, ACount);
    end;
    这是 LeftBSt,可以看到代码都是一样的,只是参数改为了unicode字符串function LeftBStr(const AText: AnsiString; const AByteCount: Integer): AnsiString;
    begin
      Result := Copy(AText, 1, AByteCount);
    end;
    所以你可以用unicode版重载的 LeftStr 替 代LeftBStr,当然参数需要的是一个unicode字符串
    也可以直接用Copy函数
    Copy(AText, 1, AByteCount);