Line | |
---|
1 | Unit 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 |
|
---|
9 | Interface
|
---|
10 |
|
---|
11 | uses
|
---|
12 | Classes;
|
---|
13 |
|
---|
14 | const
|
---|
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 |
|
---|
29 | Implementation
|
---|
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 |
|
---|
45 | END.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.