Thursday, July 28, 2011

String Split Multiple Char or A or B Conditon

char[] delimiters = new char[] { '/', '-' };
                        string[] _DateTimeSplit = Request.QueryString["StudyDate"].ToString().Split(' ');
                        string[] _Date = _DateTimeSplit[0].Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
                        string _SDate = _Date[1] + "/" + _Date[0] + "/" + _Date[2] + " " + _DateTimeSplit[1];
                        _StudyDate = Convert.ToDateTime(_SDate);