I have to split the comma – separated string in c# and needs to save it in two variables. The C# function is as follows :
public int InsertLogDetails(string RunIDStartTime, int Distribution_ID, List<string> additions, List<string> removals, bool status, string ErrorMessage)
{
int Run_ID=0;
DateTime StartTime=DateTime.Now;
//Needs to split RunIDStartTime and needs to save it in Run_ID and StartTime
}
The RunIDStartTime holds the value of Run_ID ans StartTime.(Eg: 5,Jan 23 2013 9:31AM)
Anybody please helpout. Thanks in advance.
Here is a working answer and you do not need to do .ToArray because Split already returns an array.
returns id = 5 and date = Jan 23 2013 9:31AM