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[PadLeft] - pad a string out to a given width on the left
StringTools[PadRight] - pad a string on the right to a given width
StringTools[Center] - centre a string in a given width
Calling Sequence
PadLeft( s, width )
PadRight( s, width )
Center( s, width )
Parameters
s
-
Maple string; string to be padded
width
non-negative integer; width of the resulting string
Description
The PadLeft(s, width) command adds spaces to the left of the string s to produce a string of length equal to width. If width is less than or equal to the length of s, then s is returned unchanged.
The PadRight(s, width) command adds spaces to the right of the string s to produce a string of length width. If width is less than or equal to the length of s, then s is returned unchanged.
The Center(s, width) command adds spaces to both ends of the string s to produce a string of length width. If width - length(s) is even, then an equal number of spaces are added to the left and right ends of s. If width - length(s) is odd, then the extra space is added to the left of s.
The StringTools[TrimLeft], StringTools[TrimRight] and StringTools[Trim] commands are approximate inverses of PadLeft, PadRight and Center, respectively.
Examples
The Trim* procedures are approximate inverses to the Pad* and Center procedures.
The TrimLeft procedure is not quite an inverse of PadLeft, however.
Similar remarks apply to TrimRight and Trim.
See Also
string, StringTools, StringTools[IsSpace], StringTools[Trim]
Download Help Document