I have a string which contain tags in the form < tag >. Is there an easy way for me to programmatically replace instances of these tags with special ascii characters? e.g. replace a tag like "< tab >" with the ascii equivelent of '/t'?
Any useful tutorials or code snippits?
TK
2008-09-18 16:47:55
I'm a big fan of Expresso http://ultrapico.com to guide me through the tough ones.
ddc0660
2008-09-18 16:54:17
+2
A:
using System.Text.RegularExpressions;
Regex.Replace(s, "TAB", "\t");//s is your string and TAB is a tab.
Burkhard
2008-09-18 16:48:50
+2
A:
public static Regex regex = new Regex("< tab >", RegexOptions.CultureInvariant | RegexOptions.Compiled);
public static string regexReplace = "\t";
string result = regex.Replace(InputText,regexReplace);
ddc0660
2008-09-18 16:50:56