Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
StringTools[Substitute] - search for and replace the first occurrence of a string by another string
StringTools[SubstituteAll] - search for and replace all occurrences of a string by another string
Calling Sequence
Substitute( s, from, to )
SubstituteAll( s, from, to )
Parameters
s
-
string
from
to
Description
The Substitute(s, from, to) function replaces the first occurrence of the string from in the string s by the string to, and returns the resulting string. The original string s is not modified. Strings are immutable in Maple.
The SubstituteAll(s, from, to) function replaces all occurrences of from in s by to, and returns the resulting string. The original string s is not modified.
Only the first of overlapping occurrences of from in s is subject to replacement by to.
Examples
See Also
SearchText, string, StringTools, StringTools[RegSubs]
Download Help Document