How come start_head and end_head is not storing the index of the first occurrence of <head> and </head>? But rather, it basically holding the values of std::string::npos.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <iostream>
#include <string>
#include <vector>
//"q<head>werq<b>this should be bold</b>qwerq313</head>4adfaerq";
int main ()
{
std::string input = "q<head>werq<b>this should be bold</b>qwerq313</head>4adfaerq";
std::size_t start_head = input.find ("<head>", 0);
std::size_t end_head = input.find ("</head>", 0);
std::cout << start_head;
std::cout << end_head;
return 0;