本文整理自网络,侵删。
{从字符串中提取汉字的函数}procedure StrToHanZiList(str: string; var List: TStringList);var p: PWideChar;begin if List = nil then List := TStringList.Create; List.Clear; {去除重复} List.Sorted := True; List.Duplicates := dupIgnore; p := PWideChar(str); while p^ <> #0 do begin case p^ of #$4E00..#$9FA5: List.Add(p^); end; Inc(p); end;end;
相关阅读 >>
Delphi 解决Delphi indy10下 utf8码转换的问题
Delphi让tedit控件的内容居中或右对齐,限制位数,仅允许输入数字
Delphi tstringlist 排序 customsort
更多相关阅读请进入《Delphi》频道 >>