Find Index

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
(2 intermediate revisions by one user not shown)
Line 5: Line 5:
 
Please see the [[Pad Text]] function for an additional example.
 
Please see the [[Pad Text]] function for an additional example.
  
'''Original Text:''' The text where the text 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.
+
'''Original Text:''' The text where the text is located. Accepts variables and functions such as [[$next list item]], [[$list item]], [[$random list item]], [[$previous list item]], and [[$table cell]].
  
 
'''Text to Find:''' The text within the Original text where the index is pulled from.  Accepts variables and functions such as [[$next list item]], [[$list item]], [[$random list item]], [[$previous list item]], and [[$table cell]].
 
'''Text to Find:''' The text within the Original text where the index is pulled from.  Accepts variables and functions such as [[$next list item]], [[$list item]], [[$random list item]], [[$previous list item]], and [[$table cell]].
Line 13: Line 13:
 
set(#index, $find index("UBot Studio", "Studio"), "Global")
 
set(#index, $find index("UBot Studio", "Studio"), "Global")
 
</pre>
 
</pre>
 +
  
 
Running the script sets the variable in the [[Set|set command]] to the index of the string under "text to find".
 
Running the script sets the variable in the [[Set|set command]] to the index of the string under "text to find".
 
The index of the string "Studio" in the original string "UBot Studio" is 5.
 
The index of the string "Studio" in the original string "UBot Studio" is 5.
  
[[File:findindex.png]]
+
 
 +
[[File:indx0.jpg]]

Latest revision as of 22:17, 28 December 2016

$Find Index is a Text Function.

The function returns the index of a piece of text with the original string.

Please see the Pad Text function for an additional example.

Original Text: The text where the text is located. Accepts variables and functions such as $next list item, $list item, $random list item, $previous list item, and $table cell.

Text to Find: The text within the Original text where the index is pulled from. Accepts variables and functions such as $next list item, $list item, $random list item, $previous list item, and $table cell.

[edit] Example

set(#index, $find index("UBot Studio", "Studio"), "Global")


Running the script sets the variable in the set command to the index of the string under "text to find". The index of the string "Studio" in the original string "UBot Studio" is 5.


Indx0.jpg

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox