string search = "Apple : 100";
string[] result = search .Split(':');
Works fine with below output:
result[0] ==> Apple
result[1] ==> 100
But for this:
string search = "Apple";
string[] result = search .Split(':');
Outputs:
result[0] ==> Apple
Why the output is Apple ? I Just want empty array if the delimiter is missing in the search string
.
Any help would be appreciated.