source: trunk/NewView/CharUtilsUnit.pas@ 112

Last change on this file since 112 was 112, checked in by RBRi, 18 years ago

CharUtils added

  • Property svn:eol-style set to native
File size: 913 bytes
Line 
1Unit CharUtilsUnit;
2
3// NewView - a new OS/2 Help Viewer
4// Copyright 2006-2007 Ronald Brill (rbri at rbri dot de)
5// This software is released under the GNU Public License - see readme.txt
6
7// Helper functions to work with characters
8
9Interface
10
11uses
12 Classes;
13
14const
15 CharTAB = chr(9);
16 CharCR = chr(13);
17 CharLF = chr(10);
18
19
20 TYPE
21 TSetOfChars = set of char;
22
23 // Returns true if aChar is a digit 0..9
24 Function CharIsDigit(const aChar : char) : boolean;
25
26 // Returns true if aChar is an alphabetic character a..z A..Z
27 Function CharIsAlpha(const aChar : char) : boolean;
28
29Implementation
30
31 uses
32 SysUtils;
33
34 Function CharIsDigit(const aChar : char) : boolean;
35 begin
36 Result := (aChar >= '0') and (aChar <= '9');
37 end;
38
39 Function CharIsAlpha(const aChar : char) : boolean;
40 begin
41 Result := ( (aChar >= 'A') and (aChar <= 'Z') ) or ((aChar >= 'a') and (aChar <= 'z'));
42 end;
43
44
45END.
Note: See TracBrowser for help on using the repository browser.