Delphi 分割字串函數 Extracestrings

//分割字符串 ExtractStrings
var
s: String;
List: TStringList;
begin
s := ‘about: #delphi; #pascal, programming’;
List := TStringList.Create;
ExtractStrings([';',',',':'],['#',' '],PChar(s),List);
//第一个参数是分隔符; 第二个参数是开头被忽略的字符

ShowMessage(List.Text); //about
//delphi
//pascal
//programming
List.Free;
end;

本篇發表於 未分類。將永久鍊結加入書籤。

發表迴響

您的電子郵件位址並不會被公開。 必要欄位標記為 *

*

您可以使用這些 HTML 標籤與屬性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>