程序代码为:
THzSpell.PyOfHz(Edit1.Text)//获取汉字的拼音
UpperCase(THzSpell.PyHeadOfHz(Edit1.Text))//获取拼音首字母
----------------------------------代码文件---------------------------------------------------------------------
unit HzSpell;
{ version 4.1}
interface
uses
Windows, Messages, SysUtils, Classes;
type
THzSpell = class(TComponent)
protected
FHzText: String;
FSpell: String;
FSpellH: String;
procedure SetHzText(const Value: String);
function GetHzSpell: String;
function GetPyHead: String;
public
class function PyOfHz(Hz: String): String;
class function PyHeadOfHz(Hz: String): String;
published
property HzText: String read FHzText write SetHzText;
property HzSpell: String read GetHzSpell;
property PyHead: String read GetPyHead;
end;