Replace

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "$replace is a Text Function. The function returns the original text with all instances of the search text replaced by the replace text. == Example == <pr...")
 
Line 2: Line 2:
  
 
The function returns the original text with all instances of the search text replaced by the replace text.
 
The function returns the original text with all instances of the search text replaced by the replace text.
 +
 +
'''Original Text:''' The sentence or piece of data where the item that will be replaced is located.
 +
 +
'''Search Text:''' The item being replaced.
 +
 +
'''Replace Text:''' The item that will replace the search text.
  
 
== Example ==
 
== Example ==

Revision as of 19:12, 1 May 2013

$replace is a Text Function.

The function returns the original text with all instances of the search text replaced by the replace text.

Original Text: The sentence or piece of data where the item that will be replaced is located.

Search Text: The item being replaced.

Replace Text: The item that will replace the search text.

Example

navigate("http://www.ubotstudio.com/playground/simple-form", "Wait")
wait(3)
type text(<about me textarea>, $replace("I like UBot Studio", "like", "love"), "Standard")

The original text being altered is the sentence "I like UBot Studio." Running the script replaces the search text "like" with the replace text, which is "Love". The resulting sentence is "I love UBot Studio".

File:Replace.png

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox