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
substring - extract a substring from a string
Calling Sequence
substring(string, range)
Parameters
string
-
string or symbol
range
range m..n, or an integer m
Description
The substring function extracts a substring from a string or symbol. If applied to a string, a string is returned. If applied to a symbol, a symbol is returned.
If a range is specified for range, and m and n evaluate to integers then substring will extract a substring from string starting with the mth character and ending with the nth character.
Specifying a single integer m for range is equivalent to specifying the range m..m.
Negative values for m and/or n stand for positions counted leftwards from the right end of the string. The range 1..-1 refers to the entire string. The range -20..-1 refers to the last 20 characters of the string.
If n is greater than the length of string then substring returns a string from the mth character to the end of string. If m is equal to n + 1 then substring returns the null string.
Zero values for m and/or n are not permitted, except for the case m = 1 and n = 0, which returns the null string as described above.
If either m or n fails to evaluate to an integer, then substring remains unevaluated.
Thread Safety
The substring command is thread-safe as of Maple 15.
For more information on thread safety, see index/threadsafe.
Examples
See Also
cat, length, searchtext, SearchText, selection, string, StringTools, StringTools[SubString], symbol
Download Help Document