Tuesday, September 27, 2011

Remove Open/Close Square Brackets in a sentence:

Data: [Posted Friday September 23 2011]
Output: Posted Friday September 23 2011
Solution:
Code:
string date = Regex.Replace(date, "[\\[\\]]", string.Empty);  
date = Regex.Replace(date, @"[\[\]]", string.Empty);  

1 comments: