计算机二级:delphi中获取汉字的拼音首字母
来源:优易学  2011-6-7 12:57:11   【优易学:中国教育考试门户网】   资料下载   IT书店

 

  begin
  Result := #0;
  case Byte(Value[0]) of
  176:
  case Byte(Value[1]) of
  161..196: Result := \'A\';
  197..254: Result := \'B\';
  end; {case}
  177:
  Result := \'B\';
  178:
  case Byte(Value[1]) of
  161..192: Result := \'B\';
  193..205: Result := \'C\';
  206: Result := \'S\'; //参
  207..254: Result := \'C\';
  end; {case}
  179:
  Result := \'C\';
  180:
  case Byte(Value[1]) of
  161..237: Result := \'C\';
  238..254: Result := \'D\';
  end; {case}
  181:
  Result := \'D\';
  182:
  case Byte(Value[1]) of
  161..233: Result := \'D\';
  234..254: Result := \'E\';
  end; {case}
  183:
  case Byte(Value[1]) of
  161: Result := \'E\';
  162..254: Result := \'F\';
  end; {case}
  184:
  case Byte(Value[1]) of
  161..192: Result := \'F\';
  193..254: Result := \'G\';
  end; {case}
  185:
  case Byte(Value[1]) of
  161..253: Result := \'G\';
  254: Result := \'H\';
  end; {case}
  186:
  Result := \'H\';
  187:
  case Byte(Value[1]) of
  161..246: Result := \'H\';
  247..254: Result := \'J\';
  end; {case}
  188..190:
  Result := \'J\';
  191:
  case Byte(Value[1]) of
  161..165: Result := \'J\';
  166..254: Result := \'K\';
  end; {case}
  192:
  case Byte(Value[1]) of
  161..171: Result := \'K\';
  172..254: Result := \'L\';
  end; {case}
  193:
  Result := \'L\';
  194:
  case Byte(Value[1]) of
  161..231: Result := \'L\';
  232..254: Result := \'M\';
  end; {case}
  195:
  Result := \'M\';
  196:

上一页  [1] [2] [3] 下一页

责任编辑:小草

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训