Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
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