To reproduce: var t = @" <ClassTerminator> /\* Test1 _/ public class Human { public string Name {get;set;} } </ClassTerminator> <ClassTerminator> /_ Test2 */ public class Address { public string StreetName {get;set;} } </ClassTerminator>"; Console.WriteLine(t); Note: This is executing properly in VS.