Is all of this in one string or is being read in from a file?
Do you have an example of what this text might look like?
Now, comments.
What you want to look for is the consistent differences between the two,
and just break the line there. If there are multiple "heading" and
"contents" within one variable, then you will have to itterate slightly
differently. If there is only one in each variable, then you can just do
a split.
Either way you can do a split really, but if there are 2 or more of
these things, then you will also have to analyze the way heading ends
and content begins and ends and then how heading begins.
Perhaps what you are searching for is the newline? or if windows bases
the \r\n (\n\r ? i forget which).
Either way, you should look for what the key "delimiter" might be when
parsing this content.
If you can post the text, I can redifine, etc.
-Akshay
"FIEDRICH,JAMIE (HP-USA,ex1)" wrote:
>
> I have a text file in which I want to find a specific string - call it a
> heading. Once I've found the string (heading), I want to stuff the next
> line (content) into a variable.
>
> What is the most effective way to do this?
>
> Thanks in advance,
>
> Jamie
--
http://www.5vs1.com - A Pearl Jam Fan Site
"Only when the last tree is dead, the last river damned, and the last
field paved, will we realize that we can't eat money."
"Time is long and life is short, so begin to live while you still can."
-Eddie Vedder