Replace

From UBot Studio
Jump to: navigation, search

$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.

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.

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.

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".


Rplcfunc.jpg

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox