Contains

From UBot Studio
Revision as of 15:59, 14 April 2013 by LillyT (Talk | contribs)

Jump to: navigation, search

This function is a Qualifier Function. This functions returns whether or not the text contains the search text.

  • Text refers to the list, variable, table cell or text you are evaluating.
  • Text to Search For refers to the text that is being search for in the list, variable, table cell or text.

Example

add list to list(%my list, $list from text("Apple,Banana,Plum,Persimmon", ","), "Delete", "Global")
if($contains(%my list, "Orange")) {
    then {
        navigate("google.com", "Wait")
    }
    else {
        navigate("ubotstudio.com/resources", "Wait")
    }
}

The contains qualifier evaluates the contents of the list %my list and checks to see if the text "Orange exists".

Since the text "Orange" does not exist int he list, the else command runs.

File:Contains0.png

add list to list(%my list, $list from text("Apple,Banana,Plum,Persimmon", ","), "Delete", "Global")
if($contains(%my list, "Apple")) {
    then {
        navigate("google.com", "Wait")
    }
    else {
        navigate("ubotstudio.com/resources", "Wait")
    }
}


This script will be searching for the word "Apple" within the list. Since the word "Apple" exists in the list, the then command runs.

File:Contains.png

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox