How do i set multiple delimiters?

i have this set of string:
“Name: Bente
ID: 2129
Country: North Korea”

I want to split the string so that i can get “Bente”, “2129”, “North”, and “Korea”.
I’ve just used something like string.Split(" "c) but it’s not separating some of the words separated by a \n.
If i select string(3), i want to get “2129” but i’m getting “North”.

@simplificatedd

yourstring.Split({“delimiter1”,“demlimiter 2”,“delimiter n”,vblf},StringSplitOptions.None).tolist

To set new line character as delimiter use VBLF

@simplificatedd Check attached zip file

notepad.zip (1.8 KB)

1 Like

I want to set it into an array with split. Your option is viable but it requires me to create multiple string variables. How can I make it so that i can split the text using " " and “\n”.

how do I write it down in my “assign” box? If i want to set the delimiter as a " “, i have to write a ‘c’ after the " " to indicate that it is a char variable.
For example, yourstring.Split(” "c);
What do i write for the variable of type vblf?

@simplificatedd Split ur String with respect to Newline and then split each element in array with “:” the new array with index 1 will have have required output.

Assuming that your are storing the results in an List variable.

In Assign activity use the below

list_variable = yourstring.split({" "c,vblf},StringSplitOptions.RemoveEmptyEntries).tolist

Regards,
Ranjith