Can I do string manipulation within assign activity with c#?

Why this simple split in assign activity gives an error? I am using c#. “arr” variable is an array of strings. Error says An expression tree may not contain a call or invocation that uses optional arguments.

image

Hi @ext-o ,

use below syntax

str.Split("/"c)

Regards,
Arivu

1 Like

HI,

Can you try either of the following?

arr = str.Split("/".ToCharArray())

OR

arr = str.Split(new char[] {'/'})

Regards,

HI @ext-o

Try this way

str.Split("/",StringSplitOptions.None)

If you want to print them in the message use like this

string.Join(",",str.Split("/",StringSplitOptions.None))

Regards
Sudharsan

Superb, the first one worked. Thank you!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.