Difference between revisions of "ReplaceAll Command"

From GeoGebra Manual
Jump to: navigation, search
(Created page with "<noinclude>{{Manual Page|version=5.0}}</noinclude> {command|text} ;ReplaceAll( <Text>, <Text to Match>, <Text to Replace> ) :Replaces text. :{{Example|1=<code>ReplaceAll("3cos...")
 
(added note and example)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>{{Manual Page|version=5.0}}</noinclude> {command|text}
+
<noinclude>{{Manual Page|version=5.0}}</noinclude> {{command|text}}
 
;ReplaceAll( <Text>, <Text to Match>, <Text to Replace> )
 
;ReplaceAll( <Text>, <Text to Match>, <Text to Replace> )
:Replaces text.
+
:Creates a new text containing the given ''text'' whose ''text to match'' has been replaced with the given ''text to replace''.
:{{Example|1=<code>ReplaceAll("3cos(t)+cos(2y)", "cos", "sin")</code> gives <code>"3sin(t)+sin(2y)"</code>.}}
+
:{{Example|1=<code>ReplaceAll("3cos(t)+cos(2y)", "cos", "sin")</code> creates the new text <code>"3sin(t)+sin(2y)"</code>.}}
 +
 
 +
{{Note|1=Use the [[FormulaText Command|FormulaText]] command to create a LaTeX text.}}
 +
{{Example|1=<code>FormulaText(ReplaceAll("3cos(t)+cos(2y)", "cos", "sin"))</code> creates the new LaTeX text <code>"3sin(t)+sin(2y)"</code>.}}

Latest revision as of 11:12, 15 April 2022


ReplaceAll( <Text>, <Text to Match>, <Text to Replace> )
Creates a new text containing the given text whose text to match has been replaced with the given text to replace.
Example: ReplaceAll("3cos(t)+cos(2y)", "cos", "sin") creates the new text "3sin(t)+sin(2y)".


Note: Use the FormulaText command to create a LaTeX text.
Example: FormulaText(ReplaceAll("3cos(t)+cos(2y)", "cos", "sin")) creates the new LaTeX text "3sin(t)+sin(2y)".
© 2024 International GeoGebra Institute