为了账号安全,请及时绑定邮箱和手机立即绑定

delphi函数问题?

delphi函数问题?

米琪卡哇伊 2019-03-06 11:07:06
我用delphi编写小程序的时候,用到了一个leftstr()函数,编译的时候却总是说我没有声明,这个函数要声明吗?不懂!我看delphi的帮助文件了,我的用法和他差不多呀!我的用法:leftstr(a);//a是字符串变量;
查看完整描述

2 回答

?
Helenr

TA贡献1780条经验 获得超3个赞

Returns the substring of a specified length that appears at the start of a string.

Unit

StrUtils

Category

string handling routines

Delphi syntax:

function LeftStr(const AText: AnsiString; const ACount: Integer): AnsiString; overload;
function LeftStr(const AText: WideString; const ACount: Integer): WideString; overload;

C++ syntax:

extern PACKAGE AnsiString __fastcall LeftStr(const AnsiString AText, int ACount);
extern PACKAGE WideString __fastcall LeftStr(const WideString AText, int ACount);

Description

LeftStr returns the leading characters of AText up to a length of ACount characters.

Note: If AText is an AnsiString and the current locale uses multi-byte characters, LeftStr may return more than ACount bytes. To return a specific number of bytes, use LeftBStr.

要使用单元文件StrUtils,你在uses那里使用一下

查看完整回答
反对 回复 2019-03-27
  • 2 回答
  • 0 关注
  • 964 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信