Text split
Block is used to split a string by a selected separator string or character. Separator in the “By” part can be any character or string. Left part defines the source string and argument is required. Right part defines the string used as a separator.
In case input string value is not string type returns None. In any other case returns list of values. In case separator value is not string or contained in source strings returns list of one value which is input string.
XML representation of text_split_text block
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="text_split_text">
<value name="STR">
<block type="text">
<field name="TEXT">text variable</field>
</block>
</value>
<value name="TEXT">
<block type="text">
<field name="TEXT">split value</field>
</block>
</value>
</block>
</xml>
Block is used twice in the example:
- “set user_list” row: Loads value from key “user_list” from “item” dictionary and applies the “;separator;”. Output result is list of values “administrator”, “admin” and “guest”.
- “set ip_list” row: Loads value from key “user_list” from “item” dictionary and applies the separator “;”. Output result is a list of values “8.8.8.8”, “8.8.8.4”, “8.8.8.9”.