Substring a string with each space found


#1

How to substring a string with each space found on the variable.
Example
Input: Hello how are you
Output: Array of strings with values Hello, how, are, you.
Please help on this.


#2

Hi,

split.xaml (9.7 KB)


#3

Hi @ajith.jose,
You can use the String Split function and the output will be coming in an Array of String.
You have to iterate through the loop in order to extract the words one by one.
Thanks,
Jiban


#4

Then is there any way to split with respect to some characters like comma?


#5

You can use simple Replace function here, [Your_String].Replace([Old Value], [New Value])

e.g. Let consider “Hello How Are You” is the string stored in variable called MyString, then Use Assign activity set MyString = MyString.Replace(" ", ", ").ToString

I hope this is the easiest way rather than using Split and loop the Result String array :wink:


#6

@cthamizh
Output: Array of strings with values Hello, how, are, you.


Split string by whitespace
#7

@ajith.jose

You can use any type of separator in split string activity


#8

Thank you guys.