Split text error

I use split for split text

LotNo (type string) = 086_6743 —> I want 086

I use assign = LotNo.Split("_")(0).ToString

But show error as below.

Please guide me for solve it.

Hi @fairymemay

You have to use split syntax like this

LotNo.Split("_"c).First or else LotNo.Split("_"c)(0).ToString

Thanks
Robin

1 Like

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