title: How to check if string is a proper subset of another string
body: <p>I want to check if a string is a <strong>strictly</strong> a subset of another string.
  For this end I used <a href="https://stackoverflow.com/questions/15640770/boostalgorithmcontains">boost::contains</a> and I compare the size of strings as follows:</p>
  <pre><code>#include &lt;boost/algorithm/string.hpp&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  using namespace boost::algorithm;
  
  int main()
  {
    string str1 = &quot;abc news&quot;;
    string str2 = &quot;abc&quot;;
    //strim strings using boost
    trim(str1);
    trim(str2);
    //if str2 is a subset of str1 and its size is less than the size of str1 then it is strictly contained in str1
    if(contains(str1,str2) &amp;&amp; (str2.size() &lt; str1.size()))
    {
      cout &lt;&lt;&quot;contains&quot; &lt;&lt; end;
    }
    return 0;
  }
  </code></pre>
  <p>Is there a better way to solve this problem? Instead of also comparing the size of strings?</p>
  <hr />
  <h1>Example</h1>
  <ul>
  <li><strong>ABC</strong> is a proper subset of <strong>ABC NEWS</strong></li>
  <li><strong>ABC</strong> is not a proper subset of <strong>ABC</strong></li>
  </ul>
  <hr />