I wonder if it\'s possible to use split to divide a string with several parts that are separated with a comma, like this:
10,12-JUL-16,11,0
Yes, you can:
string[] parts = str.Split(',');
Then your second part is in parts[1]
.
or:
string secondPart = str.Split(',')[1];
or with Linq:
string secondPart = str.Split(',').Skip(1).FirstOrDefault();
if (secondPart != null)
{
...
}
else
{
...
}
Also you can use not only one symbol for string splitting, i.e.:
string secondPart = str.Split(new[] {',', '.', ';'})[1];