Answer: Using DateTime format,we can get Month part from any given string date.We have to pass format in ToString method of DateTime class as MM.
For Example:-
string date_part = Convert.ToDateTime(date).ToString("MM");
Output would be :- 12
Asked In: Many Interviews |
Alert Moderator