Substring

From UBot Studio
Revision as of 19:35, 1 May 2013 by LillyT (Talk | contribs)

Jump to: navigation, search

$Substring is a Text Function.

The function returns the specified part of an original string.

The substring begins at a given starting point and extends up to the given length. Again, this function can be used the way that the other functions can be used, except this finds the determined subtext of a string.

The function can be used along with the Text Length and Find Index functions to determine the substring of an item in a string.

The text length function finds the length of the substring in the place in the substring function labeled "Number of Characters".

The find index function finds the starting point for the substring being searched for within the original text.

Original Text: The original text the substring will be pulled from. Accepts variables and functions such as $next list item, $list item, $random list item, $previous list item, and $table cell under Text to Type.

Starting Point: The starting point of the substring within the original text.

Number of Characters: The length of the substring.


Example

navigate("http://www.ubotstudio.com/playground/simple-form", "Wait")
type text(<username field>, $substring("UBot Studio", $find index("UBot Studio", "Studio"), $text length("Studio")), "Standard")

Running the script fills the field with the substring at the starting point and with the number of characters specified in the substring function. In this case the substring is the word "Studio".

File:Substring.png

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox