System.Insert - 插入字符串

procedure Insert(
  Substr: String;   {要插入的字符串; 可以是常量}
  var Dest: String; {源字符串}
  Index: Integer    {从第几个字符前插入}
);

举例:
var
  ss,s: WideString;
begin
  ss := '万一的博客';
  s := ' Delphi ';
  Insert(s, ss, 4);
  ShowMessage(ss);  {万一的 Delphi 博客}
end;


var
  ss,s: string;
begin
  ss := '万一的博客';
  s := ' Delphi ';
  Insert(s, ss, 7);
  ShowMessage(ss);  {万一的 Delphi 博客}
end;

System 单元下的公用函数目录

支持2种字符编码的。看来以前 应该尽量用widestring ,以后迁移到Unicode的IDE方便,而且写code的习惯也统一。

 posted on 2015-06-08 11:53  宝兰  阅读(155)  评论(0编辑  收藏  举报