在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
// 它们定义在 System.Character, 它可以彻底替代同单元的 TCharacter 结构体. 主要方法有: function IsControl: Boolean; function IsDigit: Boolean; function IsHighSurrogate: Boolean; function IsInArray(const SomeChars: array of Char): Boolean; function IsLetter: Boolean; function IsLetterOrDigit: Boolean; function IsLower: Boolean; function IsLowSurrogate: Boolean; function IsNumber: Boolean; function IsPunctuation: Boolean; function IsSeparator: Boolean; function IsSurrogate: Boolean; function IsSymbol: Boolean; function IsUpper: Boolean; function IsWhiteSpace: Boolean; function ToLower: Char; function ToUpper: Char; function ToUCS4Char: UCS4Char; // 以后可以不用 CharInSet()了, 不过得引用 System.Character 单元 uses System.Character; procedure TForm1.FormCreate(Sender: TObject); begin KeyPreview := True; end; procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char); begin // if Key.IsInArray(['1', '2', '3', '4', '5', '6', '7', '9', '0']) then // ShowMessage('按下了数字键'); if Key.IsNumber then ShowMessage('真的按下了数字键'); end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论