indexOf specific characters at specific locations when reading files
<p>Using indexOf after reading a file, How would one code indexOf for only specific characters before and after a word? </p>

<p>for example </p>

<p>'billy'</p>

<p>Single Quotes: 2</p>

<p>bi'lly</p>

<p>Single Quotes: 0</p>

<p>My Code</p>

<pre><code>if ( 0 &lt;= name.indexOf("'")){
        singleQuotes++;
</code></pre>

<p>My code will count all of the single quotes, How can I make it so when it reads a file with a bunch of words. To only get the single quotes at the beginning and end of each word?</p>
