Split Array


Am trying to get item[0]. Am getting end of expression expected error!
Please help!

try round brackets item(0) instead of square

1 Like

you can only access like with small brackets e.g. item(0).tostring()

1 Like

I tried it! getting this error

check item typearguement, should be string and you don’t need to specify index, just item.tostring

or splitData(1).ToString

Type argument should be string and then use item in writeline instead of item(0) otherwise you will get first character.

1 Like

Hi both thank you for your suggestions!

However i want to extract the highlighted data in the attached documents from splitData.

I would try below way.

splitData = Split(pdfdata, Environmet.Newline)

strName = splitData(3).ToString() // if you know the position
1 Like

Don’t know if this was answered yet, but seems to me that you are splitting the data into an array, then going through each item.

You will want to leave off the brackets.


You can leave off the brackets because the For Each is going through each individual item in the array. You would only use the brackets if you are accessing another array or dataRow of sorts.