本文整理自网络,侵删。
uses IOUtils, Types;
procedure StringAryDelete(var A: TStringDynArray;const index: Integer);var Count: Integer;begin Count:= Length(A); if (Count = 0) or (Index < 0) or (Index >= Count) then Exit; Move(A[Index+1], A[Index], (Count-Index)* SizeOf(A[0])); SetLength(A, Count - 1);end; procedure StringAryAdd(var A: TStringDynArray; const S: string);var C: Integer;begin C:= Length(A); SetLength(A,C+1); A[C]:= S;end;
上面的两个函数一个是用来增加 一个是用来 删除的 。
如果需要分割字符串的话 引用Strutils 使用 SplitString 即可 记得放掉哦
http://www.icy6.com/delphi/split.html
相关阅读 >>
Delphi编写的android程序获取root权限实现(2015.4.15更新,支持android 4.4)
Delphi d10.x 并行库ppl编程之 tparallel.for
Delphi 用正则表达式获取指定的字符串续取出所有符合要求的字符串
更多相关阅读请进入《Delphi》频道 >>