Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
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.
The Char(n) function, where n is an integer in the range , evaluates to the character (string of length one) whose ASCII code point is n. The number is also accepted and, in this case, the empty string is returned.
The Ord(s) function maps characters to their ASCII code points. As a special case, (in which the argument is the empty string) evaluates to . Given any nonempty string s, is equivalent to , which evaluates to the ASCII code point of the character .
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
Error, (in StringTools:-Char) integer argument is too large
See Also
cat, convert, map, op, seq, string, StringTools, StringTools[Explode]
Download Help Document