Getting Split is not a member of system.Array issue

While coding for expression “Departments.Split(Environment.NewLine.ToCharArray.StringSplitOptions.RemoveEmptyEntries)” for splitting but getting error like Split is not a member of ‘System.Array’ same for StringSplitOptions too.
Please resolve the above.


Yes Split is a member of String but not System.Array

We will use Split method to split string but not array variable.

For StringSplitOptions also getting same issue how to resolve?

HI @praveenM1

The department variable you have there, it looks like its a Array variable. Not a string…

You can only use Split function and string spit option on String variables or on a individual element in an array if you need to split what that element holds.