unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls; type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
  end; var
  Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject);
var
  p,p1,p2: PChar;
begin
  p1 := 'Delphi';
  p2 := '2009';   GetMem(p, );
  p^ := #0;   lstrcat(p, p1);
  lstrcat(p, ' ');
  lstrcat(p, p2);   ShowMessage(p); {Delphi 2009}   FreeMem(p);
end; procedure TForm1.Button2Click(Sender: TObject);
var
  p1,p2: PChar;
  buf: array[..] of Char;
begin
  p1 := 'Delphi';
  p2 := '2009';   FillChar(buf, Length(buf), #0);   lstrcat(buf, p1);
  lstrcat(buf, ' ');
  lstrcat(buf, p2);   ShowMessage(buf); {Delphi 2009}
end; procedure TForm1.Button3Click(Sender: TObject);
var
  p,p1,p2: PChar;
begin
  p1 := 'Delphi';
  p2 := '2009';
  p := GetMemory();   lstrcpy(p, p1);   lstrcat(p, ' ');
  lstrcat(p, p2);   ShowMessage(p); {Delphi 2009}   FreeMemory(p);
end; var
  buf: array[..] of Char;
procedure TForm1.Button4Click(Sender: TObject);
var
  p1,p2: PChar;
begin
  p1 := '万一的 ';
  p2 := 'Delphi 博客';   lstrcat(buf, p1);
  lstrcat(buf, p2);   ShowMessage(buf); {万一的 Delphi 博客}
end; end.

WinAPI 字符及字符串函数(9): lstrcat - 合并字符串的更多相关文章

  1. 《Python CookBook2》 第一章 文本 - 去字符串两端的空格 && 合并字符串 && 将字符串逐字符或者逐词反转

    去字符串两端的空格 任务: 获得一个开头和末尾都没有多余空格的字符串. 解决方案: 字符串对象的lstrip.rstrip和strip 方法正是为这种任务而设计的.这几个方法都不需要参数,它们会直接返 ...

  2. Lesson12——NumPy 字符串函数之 Part1:字符串操作函数

    NumPy 教程目录 1 NumPy 字符串函数 以下函数用于对 dtype 为 numpy.string_ 或 numpy.unicode_ 的数组执行向量化字符串操作. 它们基于 Python 内 ...

  3. WinAPI 字符及字符串函数(10): lstrcpy - 复制字符串

    unit Unit1; interface uses   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, For ...

  4. Lesson14——NumPy 字符串函数之 Par3:字符串信息函数

    NumPy 教程目录 1 字符串信息函数 1.1 numpy.char.count char.count(a, sub, start=0, end=None) 返回一个数组,其中包含 [start, ...

  5. 【276】◀▶ Python 字符串函数说明

    参考:Python 字符串函数 01   capitalize 把字符串的第一个字符大写,其他字母变小写. 02   center 返回一个原字符串居中,并使用空格填充至长度 width 的新字符串. ...

  6. mysql字符串函数(转载)

    对于针对字符串位置的操作,第一个位置被标记为1. ASCII(str) 返回字符串str的 最左面字符的ASCII代码值.如果str是空字符串, 返回0.如果str是NULL,返回NULL. mysq ...

  7. sql中的字符串匹配、函数大全

    假设你想建立一个与Yahoo功能相似的Internet目录.你可以建立一个表用来保存一系列的站点名称,统一资源定位器(URL),描述,和类别,并答应访问者通过在HTML form中输入要害字来检索这些 ...

  8. 【转】mysql字符串函数

    对于针对字符串位置的操作,第一个位置被标记为1(即:第一个字母索引为1). ASCII(str) 返回字符串str的 最左面字符的ASCII代码值.如果str是空字符串, 返回0.如果str是NULL ...

  9. mysql 字符串函数

    对于针对字符串位置的操作,第一个位置被标记为1. ASCII(str) 返回字符串str的 最左面字符的ASCII代码值.如果str是空字符串, 返回0.如果str是NULL,返回NULL. mysq ...

随机推荐

  1. MinGW 编译 libaom 1.0.0 注意事项

    CMake 后不生成 config/aom_version.h 文件 需要手动编写 #define VERSION_MAJOR 1 #define VERSION_MINOR 0 #define VE ...

  2. Qt websocket

    1.pro  添加 QT += websockets #ifndef MYWEBSOCKETSERVER_H #define MYWEBSOCKETSERVER_H #include <QObj ...

  3. [NOI2015]软件包管理器-树链剖分

    #include<bits/stdc++.h> using namespace std; const int maxn = 1e6+5; int n,m; int e,begin[maxn ...

  4. 使用Elasticsearch-dump迁移ES数据

    1. Elasticsearch-dump 安装 1) yum install epel-release 2) yum install nodejs 3) yum install nodejs npm ...

  5. Linux 出现telnet: 127.0.0.1: Connection refused错误解决办法

    Linux 出现telnet: connect to address 127.0.0.1: Connection refused错误解决办法 没有xinetd服务: 1./etc/init.d目录中放 ...

  6. 【winform】datagridview获取当前行停留时间

    RowStateChanged 的问题 RowStateChanged事件,也就是行状态发生变化时触发的事件,这个事件无法实现行号变化而触发这个要求,因为当我们从一行选择至另一行时,先触发原行号的状态 ...

  7. Android+openCV人脸检测2(静态图片)

    前几篇文章中有提到对openCV环境配置,这里再重新梳理导入和使用openCV进行简单的人脸检测(包括使用级联分类器) 一 首先导入openCVLibrary320 二 设置gradle的sdk版本号 ...

  8. mybatis 开发规范

  9. eclipse打开工作空间(workspace)没有任务反应

    删除workspace下的.metadata文件夹,重新打开Eclipse就OK了.

  10. 多线程处理list

    package com.zhx.web.invoice.service; import java.util.*; import java.util.concurrent.Callable; impor ...