Split
- Last UpdatedOct 16, 2024
- 1 minute read
- PI System
- PI Server 2024 R2
- PI Server
Split a string into substrings based on a specified delimiter and return an array.
Syntax
Split(s1, delimiter)
Arguments
-
s1
Input string in double quotes
-
delimiter
Space or character separating the input string such as "|" or "," in double quotes
Returns
Returns an array of substrings obtained by the separation of the input string based on the delimiter
Exceptions
-
If the delimiter doesn’t exist, an array is returned that contains one item, the original string
-
If either of the two arguments (s1 or delimiter) is not a string, the function returns an error
Example
-
Split("Value1|Value2|Value3", "|")
[Returns [Value1, Value2, Value3] ]