title: Check characters in string
body: <p>I have a basic problem that I wanted to do where I'm trying to check whether a string contains lowercase or uppercase letters. I played around with <code>islower()</code> and <code>find()</code> but I'm not getting the desired results.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cctype&gt;
  
  using namespace std;
  
  int main()
  {
      string str1 = "";
      cout &lt;&lt; "Enter phrase: ";
      getline(cin, str1);
  
      // Using islower()
      if (!(islower(str1)))
      {
          cout &lt;&lt; "No lowercase character found.";
      }
      else
      {
          cout &lt;&lt; "Lowercase character found.";
      }
  
      /* *************************************** */
  
      // Using find()
      string lower = "abcdefghijklmnopqrstuvwxyz";
      // string upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  
      if (!(str1.find(lower)))
      {
          cout &lt;&lt; "No lowercase character found.";
      }
      else
      {
          cout &lt;&lt; "Lowercase character found.";
      }
  
      // Repeat for uppercase letters
  
      return 0;
  }
  </code></pre>
  
  <p>Using <code>islower()</code> doesn't work because it seems to be expecting a <code>char</code> instead of a <code>string</code>. With <code>find()</code>, my test output always defaults to "Lowercase character found." Also, I've tried <code>string::find_first_of()</code> in place of <code>find()</code> but the results were not good either. Wouldn't either of these last two mthods check the string character by character until either lowercase or uppercase is found as defined in the <code>if</code> statements? I'd appreciate it if someone could please shed some light on this for me with an example.</p>