You can find the index of your start element and end element by using System.String.IndexOf("// Program Begin") and
System.String.IndexOf("// Program End")
details here[
^]
Then you can do a System.String.Substring(firstIndex, numberOfcharacters)
details here[
^]
The numberOfCharacters can be retrieved by subtracting both indexes in the right order.
Good luck!