String array int32 array convert

I have a single string “1\2\9\15\18” which I split into an array and assigned it as follows:

strArray (type string array) = Split(SingleString (type string)," \ ")

Note: Backslash is without any spacing between quotations.

So now strArray has a value of {“1”, “2”, “9”, “15”, “18”}

I want to convert this string into array of Int32.

I tried assigning Int32 = Convert.ToInt32(SingleString)

Result Error: String To Int32 Convert: Can not assign 'Convert.ToInt32(SingleString)' to 'Int32'.

How to fix this?

@private_matter please try this one.
->yourStringArr.Select(Function (s) cint(s.trim)).toArray

where do i place it?

Main.xaml (7.4 KB)
@private_matter please check

->ABC is string type array and IntArray is Int Type.

1 Like

@private_matter if your problem solved, please mark it as a solution

no error is showing however, output is not working as expected. I have write line with Int32array (type Int32 array).toString showing lines as System.Int32 as output instead of numbers. Trying to figure out where’s the issue.

@private_matter share your workflow. its working for me

cannot share workflow as its confidential.

@private_matter just share string part. I have shared my part and it is running for me

alright one sec I’ll do a demo and share it

1 Like

Demo.xaml (8.6 KB)

@private_matter in this where you are using array?

No worries. Did a stupid mistake that I always forget to do. I should type arrayInt(CurrentItem).toString instead of arrayInt.ToString. All working now.

1 Like

@private_matter Great. We learn from mistakes. Happy automation

Yes thx practice is the key.

1 Like

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