string::find()
has an overload that specifies the position to start the search. So simply start a second search, starting at the end of <ID>
, to look for </ID>
. You are after what comes in between the two. Pretty simple really.
However, as suggested elsewhere, there are a lot of XML parsers out there. Using a full XML parser would be recommended if the input file could have some variations.
0
solved How to parse txt file from middle to particular string using C++?