Regular Expression Remove Day Name And Date Suffix In C#
In a situation where i want to format this date value from (Tuesday 19th March 2013) to (19 March 2013). I made a regular expression by applying look behind approach and ends with behavior in strings.
Here's the expression:
:)
indicatorDate = Regex.Replace(indicatorDate, @"(\b[A-Za-z]*day\b)|((?<=[0-9])[a-zA-z]{2})", string.Empty, RegexOptions.IgnoreCase);
Comments
Post a Comment