Split function error strict dissallows the implict convertion from stringn to char

iam getting this kind of error can any one tell me what exactly the problem is .

Try below mentioned options and see if it works

  1. strArr = str1.Split(Convert.ToChar("/"))
  2. str1.Split("/"c)

The problem is that Split method accepts parameter of type Char and “/” is a string.

If you write “/”.ToCharArray then your string is converted to an array of chars (with 1 element in this case). This is also what @Akash_Jain suggested, only using different methods.

1 Like

thanks its working . :+1:

Can you mark this as a solution:-)

solution given by @Akash_Jain works :slight_smile: