xml comment tags
-
Hi there, I am havin an enormous amount of c++ comments /** blabla **/ to be translated into xml tags /// /// blabla /// is there a way to automate this in vs .net 2003 thaks, stonee
stonee74 wrote: is there a way to automate this in vs .net 2003 Macros. ORACLE One Real A$#h%le Called Lary Ellison
-
Hi there, I am havin an enormous amount of c++ comments /** blabla **/ to be translated into xml tags /// /// blabla /// is there a way to automate this in vs .net 2003 thaks, stonee
You could do it with macros, but I don't think I would. I'd be more likely to write a C# program that opened the file and used regex to do the replacements. I'd use a regex something like: Regex regex = new Regex(@" /\*\* # start of comment \s+ (? # capture to named Comment .+?\s+ # comment text ) # end of capture \s+ \*\*/ # end of comment.", RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace); and then use a MatchEvaluator function like: static public string Evaluator(Match match) { string[] lines = match.Groups["Comment"].Value.Split('\n'); for (int i = 0; i < lines.Count; i++) lines[i] = "///" + lines[i]; return String.Join("\n", lines); }