Delphi中取得汉字的首字母function Tdm.GetHzPy(const AHzStr: string): string;
Delphi中取得汉字的首字母
const
Delphi中取得汉字的首字母  ChinaCode: array[
0..250..1] of Integer = ((16011636), (16371832), (18332077),
Delphi中取得汉字的首字母  (
20782273), (22742301), (23022432), (24332593), (25942786), (99990000),
Delphi中取得汉字的首字母  (
27873105), (31063211), (32123471), (34723634), (36353722), (37233729),
Delphi中取得汉字的首字母  (
37303857), (38584026), (40274085), (40864389), (43904557), (99990000),
Delphi中取得汉字的首字母  (
99990000), (45584683), (46844924), (49255248), (52495589));
Delphi中取得汉字的首字母var
Delphi中取得汉字的首字母    i, j, HzOrd: integer;
Delphi中取得汉字的首字母
//    Hz: string[2];
Delphi中取得汉字的首字母
begin
Delphi中取得汉字的首字母    i :
= 1;
Delphi中取得汉字的首字母    
while i <= Length(AHzStr) do
Delphi中取得汉字的首字母    begin
Delphi中取得汉字的首字母        
if (AHzStr[i] >= #160) and (AHzStr[i + 1>= #160) then
Delphi中取得汉字的首字母        begin
Delphi中取得汉字的首字母            HzOrd :
= (Ord(AHzStr[i]) - 160* 100 + Ord(AHzStr[i + 1]) - 160;
Delphi中取得汉字的首字母            
for j := 0 to 25 do
Delphi中取得汉字的首字母            begin
Delphi中取得汉字的首字母                
if (HzOrd >= ChinaCode[j][0]) and (HzOrd <= ChinaCode[j][1]) then
Delphi中取得汉字的首字母                begin
Delphi中取得汉字的首字母                    Result :
= Result + char(byte('A'+ j);
Delphi中取得汉字的首字母                    
break;
Delphi中取得汉字的首字母                end;
Delphi中取得汉字的首字母            end;
Delphi中取得汉字的首字母            Inc(i);
Delphi中取得汉字的首字母        end 
else Result := Result + AHzStr[i];
Delphi中取得汉字的首字母        Inc(i);
Delphi中取得汉字的首字母    end;
Delphi中取得汉字的首字母end;

很久前的代码,忘记了来源,很好用

相关文章:

  • 2021-05-31
  • 2022-02-23
  • 2021-12-04
  • 2021-12-17
  • 2022-12-23
  • 2021-12-21
  • 2021-08-22
  • 2021-09-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2022-12-23
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案