Trim for System.Array

Hello,

I am trying to use item.trim.split in For each Activity(for each ITEM in strArray) but the error Im getting is ‘trim is not a member of Sytem.Array’.

How to resolve this. I tried adding Assembly Reference manually in your xaml file. But no change

Thanks,
AditiGandhi

Try item.ToString.Trim

@KarthikByggari
I have AddDataRow in for each loop where AddRow is - “{item.ToString.trim.split(“ ”.ToCharArray.Trim)(0), item.ToString.trim.split(“ ”.ToCharArray.Trim)(1), item.ToString.trim.split(“ ”.ToCharArray.Trim)(2), item.ToString.trim.split(“ ”.ToCharArray.Trim)(3)}”

Please use typeArgument as String thats enough.

Please find the below screenshot.

Thanks,

David.

3 Likes

@KarthikByggari Still the same error

Can you please share your array values is it a ArrayofString…?

Value of 1-Dimensional array of string cannot be converted into string

1 Like

@Palaniyappan
Still I can see the same issue

1 Like

@David3
Yes the value of Typeargument is string only

Kindly share us a sample input and output we need from it
@AditiGandhi

aaha i didnt see this
Fine no worries
can i have a sample input and output that we need from it
@AditiGandhi

will you share your xaml or input?

1 Like

@Palaniyappan
This is the Input and output sheet

Iam reading the data from the inputExcel cell and the result is stored into str. Now assign an array strArr=str.Split(Environment.NewLine.TocharArray).
Ad d for each ITEM in strArr where ITEM is string.
Add AddDataRow activityinto for each loopInputExcel.xlsx (8.2 KB) OutputExcel.xlsx (8.3 KB)

split it by VbLf instead of environment.newline

Main.xaml (15.4 KB)

try this

To trim (or different edit) of all items in the source array (arrInput), you can use this expression:

arrInput=arrInput.Select(Function(x) x.Trim).ToArray

image

1 Like