I have a array of string in which words are to be separated by space

studio
string

#1

Q045948 05052018 30042019 22 2304.000
J045948 05062018 30042019 22 2304.000

In the above example of array of string the list may go long in the said pattern i want to pick up ‘each word’ in my variable and display it in a message box


#2

Hi @NikhilNagda,

Please refer this post.


#3

Hi @NikhilNagda,

take a look at this .xaml
test.xaml (6,1 KB)

Result:
Captura


#4

Hi i am getting error, can you temme which activity you have used there?


#5

Hi,

Split String activity is used.
image

The error is because package is not installed or updated.
Click on Manage packages on the top of activities pane and install package.


#6

Hi Thanks @Pablo_Sanchez and @SaranyaKishore for the help but, i forgot to mention the lenght of the white spaces are not fixed. they always vary


#7

Hi
You can use below expression

new System.Text.RegularExpressions.Regex("\s+").Split(“Q045948 05052018 30042019 22 2304.000”)

This will return array of string, you can print each string in message box using loop or store it.


#8

As @Bharat mentioned, regex is much easier way to use.

A slight modification to this expression will work fine.
Assign it to String Array variable.

system.Text.RegularExpressions.Regex.Split(string_input,"\s+")