void ClearDuplicateLines(CodeBlockNested block) { List <String> lines = block.Lines().ToList(); for (Int32 i = 0; i < lines.Count(); i++) { lines[i] = lines[i].Trim(); } { Int32 i = 0; while (i < lines.Count()) { Int32 j = i + 1; while (j < lines.Count()) { if (String.Compare(lines[i], lines[j]) == 0) { lines.RemoveAt(j); } else { j += 1; } } i += 1; } } block.Clear(); block.AppendLines("", lines); }