StringTools[Char] - map a number to the corresponding character
StringTools[Ord] - map a character to its ASCII code point
|
Calling Sequence
|
|
Char( n )
Ord( s )
|
|
Parameters
|
|
n
|
-
|
integer in the range
|
s
|
-
|
Maple string
|
|
|
|
|
Description
|
|
•
|
The procedures Char and Ord provide a bijective mapping between the characters that may appear in Maple strings and the integers in the range via the (8-bit) ASCII character set. These procedures are similar to the homonymous operators in Pascal (and its descendents) and other languages in which characters are not an integer data type.
|
•
|
Note the relations Char( Ord( s ) ) = s[ 1 ], for any nonempty string s, and Ord( Char( n ) ) = n, for any integer n in the range . Thus, Char and Ord are nearly mutual inverses.
|
•
|
These functions are part of the StringTools package, and so they can be used in the form Char(..) only after executing the command with(StringTools). However, they can always be accessed through the long form of the command by using the form StringTools[Char](..).
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
>
|
|
| (9) |
>
|
|
>
|
|
| (10) |
|
|
Download Help Document
Was this information helpful?