SplitString (String str, String separator1, String separator2)
Name | SplitString |
Applicable To (DataType) | String |
Purpose | To split a string into multiple parts. |
Description | Splits a string into multiple parts along the specified separator string. |
Return Type | String |
Syntax | str [System.String] – string to split. |
separator1 [System.String] – separator string 1 for parsing the string. | |
separator2 [System.String] – separator string 2 for parsing the string. |
![](https://documentation.astera.com/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Fastera-software%2FAstera_Data_Stack_v9%2Fblob%2Fmain%2F.gitbook%2Fassets%2Fproperties%2520%2811%29.png&width=768&dpr=4&quality=100&sign=d6d6e7cb&sv=1)
Example
In this example, we are passing the required parameters by the function transformation through a Variables object.
Where,
str = flourine-chlorine-bromine-iodine-astatine-helium-neon-argon,krypton,xenon
separator1 = -
separator2 = ,
![](https://documentation.astera.com/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Fastera-software%2FAstera_Data_Stack_v9%2Fblob%2Fmain%2F.gitbook%2Fassets%2Fdataflow%2520%2812%29.png&width=768&dpr=4&quality=100&sign=cc76eab3&sv=1)
Right-click on the function transformation object and select Preview Output. You can see that Astera Data Stack has split the string into 10 parts based on the given separators.
![](https://documentation.astera.com/~gitbook/image?url=https%3A%2F%2Fgithub.com%2Fastera-software%2FAstera_Data_Stack_v9%2Fblob%2Fmain%2F.gitbook%2Fassets%2Foutput%2520%288%29.png&width=768&dpr=4&quality=100&sign=98ec1587&sv=1)