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[Map] - map a Maple procedure onto a string
StringTools[AndMap] - perform mapped disjunction over a string
StringTools[OrMap] - perform mapped conjunction over a string
Calling Sequence
Map(p, s)
AndMap(p, s)
OrMap(p, s)
Parameters
p
-
anything; typically, a Maple procedure to apply to string s
s
string
Description
The Map(p, s) function applies p to each character in string s. The mapped procedure p should map characters to characters. However, if a string of length greater than one is returned in any call to p, only the first character of the returned string is used. The mapped procedure p can return an empty string to terminate the output string at that point. The result of a call to Map is the string returned by . However, Map is more efficient.
Map is a special version of map for strings. Unlike map, extra arguments included in the call to Map are not passed to the calls to p.
The AndMap(p, s) function applies p to each character in string s. If p returns the value true when applied to each character of s, AndMap returns the value true. If p returns the value false when applied to any character of s, false is returned as the final result of the call to AndMap. Otherwise, AndMap returns the result FAIL.
The characters of s are visited in order and only as many characters as are needed to determine the result of AndMap are examined.
The AndMap function computes the value
foldl( `and`, true, op( map( p, Explode( s ) ) ) )
efficiently.
The OrMap(p, s) function applies p to each character in string s and computes the conjunction of the values of p.
The result of evaluating p at each character of s is evaluated, in order, from left to right. Each call must return one of the values true, false, or FAIL. If true is returned at any call to p, the value true is returned as the result of the call to OrMap. Otherwise, if the value FAIL is returned at any call to p, FAIL is returned as the result of the call to OrMap. Otherwise, OrMap returns the result false.
Like AndMap, the OrMap procedure tests the characters of s in order, and returns as soon as it is possible to determine the final result.
These functions are part of the StringTools package, and so they can be used in the form Map(..) 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[Map](..).
Examples
See Also
cat, FAIL, map, seq, string, StringTools, StringTools[Capitalize], StringTools[Explode], StringTools[IsASCII], StringTools[IsUpper], StringTools[LeftFold]
Download Help Document