I have a file I am bringing into a RTB.
Let’s say it looks something like this:
// Some Title
// Some Author
// Created on
// Created by
//
Format:
"Text Length" : 500 lines
"Page Length" : 20 pages
Component: 123456
"Name" : Little Red Riding Hood
"Body Length" : 13515 lines
........etc // can have any number of lines under 'Component: 123456'
Component: abcd
"Name" : Some other Text
"Body Length" : 12 lines
........etc // can have any number of lines under 'Component: abcd'
... etc, etc // This can occur thousands of times as this file has an unset length.
Now what I would like to do is store everything from Component: 123456 until it reaches the next Component (which happens to be abcd) and store everything into the List<string> position 0. The next one will be in position 1.. and so on until the entire file is read.
Does anyone know how to do this? — I don’t necessarily need to use List<string>
Well, you could do something like:
(It’s more efficient to ignore the bits before the first component, but it makes the code more complicated.)