How can I split a C# string based on the first occurrence of the specified character? Suppose I have a string with value:
101,a,b,c,d
I wa
var pieces = myString.Split(',', 2);
This won't work. The overload will not match and the compiler will reject it.
So it Must be:
char[] chDelimiter = {','}; var pieces = myString.Split(chDelimiter, 2);