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

activities
studio

#1

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


#2

Try below mentioned options and see if it works

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

#3

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.


#4

thanks its working . :+1:


#5

Can you mark this as a solution:-)