As far as I understand it, the String.Split method will break up a string based on a specified separator and enter these sub-strings as elements of an array.
For the sake of understanding this (and eventually using it) I've assembled a simple version of this to see how it works, but when I try to run it I get an "IndexOutofRangeException: Array index is out of range". I assume this means that it runs out of array index points to enter the sub-strings into, but I don't understand how that could happen, because I'm using a dynamic and not built-in array.
Here's my code:
var highestPriority = "1,2,3";
var priorityCache = highestPriority.Split("," [3]);
I've also tried doing this and explicitly declaring the variable types outside of the function, but that doesn't seem to have any effect.
Thanks for any help you can provide.