Delphi Length函数
unit Unit1; interface uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls; type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; var
Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject);
var
arrayA: array of Integer;
arrayB: array[0..5] of Integer;
s1: string;
s2: WideString;
s3: string[30]; begin
SetLength(arrayA, 3);
ShowMessage(IntToStr(Length(arrayA))); //用Length取得动态数组的长度
ShowMessage(IntToStr(Length(arrayB))); //用Length取得静态数组的长度 s1 := '你好!';
s2 := '你好!';
s3 := '你好!';
ShowMessage(IntToStr(Length(s1))); //用length 取得AnsiString的实际使用长度
ShowMessage(IntToStr(Length(s2))); //用Length取得WideString的实际使用长度
ShowMessage(IntToStr(Length(s3))); //Length只能取得string的实际使用长度 end; end.
Delphi Length函数的更多相关文章
- delphi公共函数 UMyPubFuncFroc--版权所有 (C) 2008 勇者工作室
{*******************************************************} { } { Delphi公用函数单元 } { } { 版权所有 (C) 2008 勇 ...
- delphi字符串函数大全
转帖:delphi字符串函数大全 2009-11-17 16:43:55 分类: delphi字符串函数大全 ━━━━━━━━━━━━━━━━━━━━━首部 function StringToGUID ...
- delphi公用函数
{*******************************************************} { } { Delphi公用函数单元 } { } { 版权所有 (C) 2008 } ...
- MD5 与 SHA 在 Delphi 中函数实现,加密密码
MD5 与 SHA 在 Delphi 中函数实现. 为了加密密码,必须使用一种算法,查询资料,比较好的方法是使用:MD5等算法,参考:Delphi XE8 支持MD5 第一种方式是:引用 System ...
- Delphi部份函数,命令,属性中文说明
Abort 函数 引起放弃的意外处理 Abs 函数 绝对值函数 AddExitProc 函数 将一过程添加到运行时库的结束过程表中 Addr 函数 返回指定对象的地址 AdjustLineBreaks ...
- (转载)delphi 常用函数(数学)
delphi 常用函数(数学) Delphi中怎么将实数取整? floor 和 ceil 是 math unit 里的函数,使用前要先 Uses Math.trunc 和 round 是 system ...
- Delphi回调函数及其使用
Delphi回调函数及其使用 1 回调函数的概述 回调函数是这样一种机制:调用者在初始化一个对象(这里的对象是泛指,包括OOP中的对象.全局函数等)时,将一些参数传递给对象,同时将一个调用者可以访问的 ...
- Delphi过程函数传递参数的八种方式
今天一同事问我为什么有些过程函数里面有Var而有些没有,不解,遂到网上百度,得解.快哉,快哉. 在Delphi过程.函数中传递参数几个修饰符为Const.Var.Out.另一种不加修饰符的为默认按值传 ...
- Delphi 常用函数(数学函数)round、trunc、ceil和floor
源:Delphi 常用函数(数学函数)round.trunc.ceil和floor Delphi 常用函数(数学) Delphi中怎么将实数取整? floor 和 ceil 是 math unit 里 ...
随机推荐
- 慕课linux学习笔记(四)常用命令(1)
Root 表示当前登录用户 Localhost 主机名 ~ 当前所在位置(~表示/root) # 超级用户 $ 普通用户 命令 1.pwd 显示当前所在位置 2.ls 查询目录中的内容 -a 显示所有 ...
- WordPress插件制作教程(五): 创建新的数据表
上一篇讲解了怎样将数据保存到数据库,今天为大家讲解创建新的数据表,也就是说当我们激活插件的时候,会在该数据库下面创建一个新的数据表出来.原理很简单,激活插件的时候运行创建数据库的代码.看下面代码: & ...
- NFine常见错误
1.新增数据录入录入不进去提示:An error occurred while updating the entries.See the inner exception for details. 这样 ...
- javascript if 和else 语句练习
1.标准体重://男士体重=身高-100±3<br />//女士体重=身高-110±3<br />//输入性别.身高.体重,查看体重是否标准. <script type= ...
- 【转】ios开发之生成所缩略图方式
亲测:两种方式都有效 第一种方式:缩略成固定的尺寸大小 - (UIImage *)thumbnailWithImageWithoutScale:(UIImage *)image size:(CGSiz ...
- Windows文件居然有解锁一说,并且还会引起SignTool Error,真是昏倒!
I'm running Windows 7 and when I try to run a batch file, it says, "The publisher could not be ...
- 统计的基本操作语法 <第五篇>
1.创建统计语法: CREATE STATISTICS statistics_name ON { table_or_indexed_view_name } ( column [ ,...n ] ) [ ...
- logstash 防止实际处理时间跟事件产生时间略有偏差
"message" => " 10.168.255.134 [12/Sep/2016:16:30:40 +0800] \"GET /resources/p ...
- 在Struts2中集成Spring详细讲解
Spring的官方定义是:一个轻量级的IoC和Aop容器框架,它使用了一种叫做依赖注入的技术. 所谓依赖注入,就是指将创建对象以及协议依赖对象之间合作的责任从对象自身中转移到"工厂" ...
- jquery datepicker日期控件用法
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.c ...