可用API函数IsDBCSLeadByte(byte(sTest[1]));例子:procedure TForm1.Button1Click(Sender: TObject);
var
  sTest: string;
begin
  sTest := '中文字';
  if IsDBCSLeadByte(byte(sTest[1])) then ShowMessage('Yes 1');
end;

解决方案 »

  1.   

    procedure Num(str:String;var char,Interpunction:Integer); //interpunction:标点个数  char:汉字个数
    var
      i:Integer;
    begin
      i:=1;
      char:=0;
      Interpunction:=0;
      if Length(str)>0 then
        repeat
          if (ord(Str[i])>=129) and (ord(str[i])<=254)
          and (ord(str[i+1])>=64) and (ord(str[i+1])<=254) then
          begin
            if (ord(str[i])>=161) and (ord(str[i])<=169) then
            begin
              Interpunction:=Interpunction+1;
              i:=i+2;
            end
            else
            begin
              i:=i+2;
              char:=char+1;
            end;
          end
          else
            i:=i+1;
        until i>=length(str);
    end;
      

  2.   

    可能我没有把问题说清楚!比如说已知字体名"Arial",如何编写代码判断他是英文字体还是汉文字体?