Java count words repeated in string : <p>I Know this quetion has been asked quite few times already but I have a twist.</p>

<p>I have a below string and I wan to check the count how many times given word is repeated in the string.</p>

<pre><code>String randomText = "AbDdfSwapnilswapniljsdncdsbswapnil"
</code></pre>

<p>How to count the word <code>"swapnil"</code> is repeated?</p>
