Blog Map
[Table of Contents] [Next Topic] [Blog Map] This blog is inactive. New blog: EricWhite.com/blog
We are not interested in the groups that don’t contain code, so let's get rid of them. To do this, we simply tack a call to the Where operator on the end:
Dim groupedCodeParagraphs = paragraphsWithText _ .GroupAdjacent(Function(p) p.Style) _ .Where(Function(g) g.Key = "Code")
Now, when we run this, we see:
Group of paragraphs styled CodeCode using System;CodeCode class Program {Code public static void Main(string[] args) {Code Console.WriteLine("Hello World");Code }Code }Code Group of paragraphs styled CodeCode Hello World
We're getting really close to what we want. We only need to find the comment for each group.
[Table of Contents] [Next Topic] [Blog Map]