Replace

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 3: Line 3:
 
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.  
+
'''Original Text:''' The sentence or piece of data where the item that will be replaced is located.  Accepts variables and functions such as [[$next list item]], [[$list item]], [[$random list item]], [[$previous list item]], and [[$table cell]] under Text to Type.
  
'''Search Text:''' The item being replaced.
+
'''Search Text:''' The item being replaced.  Accepts variables and functions such as [[$next list item]], [[$list item]], [[$random list item]], [[$previous list item]], and [[$table cell]] under Text to Type.
  
'''Replace Text:''' The item that will replace the search text.
+
'''Replace Text:''' The item that will replace the search text. Accepts variables and functions such as [[$next list item]], [[$list item]], [[$random list item]], [[$previous list item]], and [[$table cell]] under Text to Type.
  
 
== Example ==
 
== Example ==

Revision as of 19:26, 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. Accepts variables and functions such as $next list item, $list item, $random list item, $previous list item, and $table cell under Text to Type.

Search Text: The item being replaced. Accepts variables and functions such as $next list item, $list item, $random list item, $previous list item, and $table cell under Text to Type.

Replace Text: The item that will replace the search text. Accepts variables and functions such as $next list item, $list item, $random list item, $previous list item, and $table cell under Text to Type.

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