A
Allerdyce.John
I have my source string like this:
As i step thru the debugger, I can't understand why
namePosStart is 2
namePosEnd is 15
I expect:
namePosStart is 9
namePosStart is 11
a line: <TestCase name="testcase1">
Here is my code:
cout << "a line: " << aLine << endl;
string::size_type lastPos = aLine.find_first_of("<TestCase", 0);
if (lastPos != string::npos) {
string::size_type namePosStart = aLine.find_first_of("name=\"",
lastPos);
string::size_type namePosEnd = aLine.find_first_of("\"",
namePosStart + 1);
}
I print out 'aLine' to make sure I get the line correctly:
a line: <TestCase name="testcase1">
I appreciate if anyone can help.
As i step thru the debugger, I can't understand why
namePosStart is 2
namePosEnd is 15
I expect:
namePosStart is 9
namePosStart is 11
a line: <TestCase name="testcase1">
Here is my code:
cout << "a line: " << aLine << endl;
string::size_type lastPos = aLine.find_first_of("<TestCase", 0);
if (lastPos != string::npos) {
string::size_type namePosStart = aLine.find_first_of("name=\"",
lastPos);
string::size_type namePosEnd = aLine.find_first_of("\"",
namePosStart + 1);
}
I print out 'aLine' to make sure I get the line correctly:
a line: <TestCase name="testcase1">
I appreciate if anyone can help.