Getting specific text from a file using function find()

Hey guys , i have a sting which contains data like this.
1
2
<fefefefefwfwfewfew>124s2d33<!xewexewxw>
<cewcewcwewcwecewwew>34532d3d3<!sdedcee>


using string find() i can the line which i want. for example.
 
string find(fefefefefwfwfewfew) ;


will give me the whole line. but if i were to just want it to read and stop when it reaches a < , how do i go about doing this? the output should just read 123s2d33 and not the whole string.
You can't. String's find function only works on strings.

Reading a whole line into a string and parsing that is not a bad thing. The fact, i/o is slow, and is almost never done byte at a time. Of course it complicates your algorithm when you've read more than you need, but it's still quicker than doing byte by byte reads.
Topic archived. No new replies allowed.