This stupid one has got me a few times. You try to use split the way everyone else appears to be using it in all the examples out there but you get this error:
Argument type ‘string’ is not assignable to parameter type ‘char’
The answer is simple: use single quotes.
So don’t do this:
Why is this? To quote the accepted answer on this Stackoverflow question:
Single quotes encode a single character (data type char), while double quotes encode a string of multiple characters.
Split() wants a char and using single quotes gives it what it wants.
Understanding how a programming language works is a surefire way to be a better developer. Read more.