 <p>You might want to look into the <code>strchr</code> function which searches a string for a given character:</p> <pre><code>include &lt;string.h&gt; char *strchr (const char *s, int c); </code></pre> <blockquote> <p>The strchr function locates the first occurrence of c (converted to a char) in the string pointed to by s. The terminating null character is considered to be part of the string.</p> <p>The strchr function returns a pointer to the located character, or a null pointer if the character does not occur in the string.</p> </blockquote> <p>Something like:</p> <pre><code>if (strchr (",.();:-\"&amp;?%$![]{}_&lt;&gt;/#*_+=", curChar) != NULL) ... </code></pre> <p>You'll have to declare <code>curChar</code> as a <code>char</code> rather than a <code>string</code> and use:</p> <pre><code>curChar = paragraph[subscript]; </code></pre> <p>rather than:</p> <pre><code>curChar = paragraph.substr(subscript, 1); </code></pre> <p>but they're relatively minor changes and, since your stated goal was <code>I want to change the if statement into [something] more meaningful and simple</code>, I think you'll find that's a very good way to achieve it.</p>