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函数的更多相关文章

  1. delphi公共函数 UMyPubFuncFroc--版权所有 (C) 2008 勇者工作室

    {*******************************************************} { } { Delphi公用函数单元 } { } { 版权所有 (C) 2008 勇 ...

  2. delphi字符串函数大全

    转帖:delphi字符串函数大全 2009-11-17 16:43:55 分类: delphi字符串函数大全 ━━━━━━━━━━━━━━━━━━━━━首部 function StringToGUID ...

  3. delphi公用函数

    {*******************************************************} { } { Delphi公用函数单元 } { } { 版权所有 (C) 2008 } ...

  4. MD5 与 SHA 在 Delphi 中函数实现,加密密码

    MD5 与 SHA 在 Delphi 中函数实现. 为了加密密码,必须使用一种算法,查询资料,比较好的方法是使用:MD5等算法,参考:Delphi XE8 支持MD5 第一种方式是:引用 System ...

  5. Delphi部份函数,命令,属性中文说明

    Abort 函数 引起放弃的意外处理 Abs 函数 绝对值函数 AddExitProc 函数 将一过程添加到运行时库的结束过程表中 Addr 函数 返回指定对象的地址 AdjustLineBreaks ...

  6. (转载)delphi 常用函数(数学)

    delphi 常用函数(数学) Delphi中怎么将实数取整? floor 和 ceil 是 math unit 里的函数,使用前要先 Uses Math.trunc 和 round 是 system ...

  7. Delphi回调函数及其使用

    Delphi回调函数及其使用 1 回调函数的概述 回调函数是这样一种机制:调用者在初始化一个对象(这里的对象是泛指,包括OOP中的对象.全局函数等)时,将一些参数传递给对象,同时将一个调用者可以访问的 ...

  8. Delphi过程函数传递参数的八种方式

    今天一同事问我为什么有些过程函数里面有Var而有些没有,不解,遂到网上百度,得解.快哉,快哉. 在Delphi过程.函数中传递参数几个修饰符为Const.Var.Out.另一种不加修饰符的为默认按值传 ...

  9. Delphi 常用函数(数学函数)round、trunc、ceil和floor

    源:Delphi 常用函数(数学函数)round.trunc.ceil和floor Delphi 常用函数(数学) Delphi中怎么将实数取整? floor 和 ceil 是 math unit 里 ...

随机推荐

  1. vector的用法总结

    Reference Constructors vector Constructs a vector of a specific size or with elements of a specific ...

  2. push方法的页面间跳转--

    一,自定义动画写push方法-- 添加coreGraphics.framework框架 在CATransitionAnimation.h文件里面引入-- #import <QuartzCore/ ...

  3. 将less编译成css的gulp插件

    简介:gulp是前端开发过程中对代码进行构建的工具,是自动化项目的构建利器:她不仅能对网站资源进行优化,而且在开发过程中很多重复的任务能够使用正确的工具自动完成:使用她,我们不仅可以很愉快的编写代码, ...

  4. php array_combine 把array的默认键改成指定的字符串

    array(2) { [0] => array(6) { [0] => string(1) "1" [1] => string(10) "1470650 ...

  5. python的and与or剖析

    1.只含有and的表达式 In []: and True and ' Out[]: ' In []: and and True and 'long' Out[]: 从左向右,遇到False,则返回改值 ...

  6. PHP-FPM小故障解决记录

    前天昨天发生的事. 阿里云升级MYSQL,申请只读库之后,IP发生了改变,PHP中关于数据库的连接都需要修改. 我们是以实例名作为统一连接字符的. 但在其中一台后端机器上,死活不生效. 就是如何是用I ...

  7. 5.1.1 读取Redis 数据

    Redis 服务器是Logstash 推荐的Broker选择,Broker 角色就意味会同时存在输入和输出两个插件. 5.1.1 读取Redis 数据 LogStash::Input::Redis 支 ...

  8. Windows下连接php5.3+sql server2008

    php连接sql server真是一件闹心的事, 折腾了许久,今天有了点起色,还是不错的. mssql extension is not available anymore on Windows wi ...

  9. Linux权限机制

    权限是操作系统用来限制用户.组.进程对操作系统资源(文件.设备等)的访问的机制 权限分为:读.写.执行,一般表示为 r.w.x http://itercast.com/lecture/22 每个文件或 ...

  10. 【剑指offer】面试题30:最小的 k 个数

    题目: 输入n个整数,找出其中最小的K个数.例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4个数字是1,2,3,4,. 思路: 这个是O(nlogk)时间复杂度的思路:用一个容器来保存最先 ...