Inject character between substring of a string in Java : <p>I have a list of words stored in a list, words.</p>

<p><code>private String[] words = new String[]{"world", "you"};</code></p>

<p>I then have a string, helloWorld</p>

<p><code>private String helloWorld = "Hello world how are you?";</code></p>

<p>I would like to create a function that will take a string (in this case, helloWorld) and it will look case-insensitively to see if any of the strings in the <code>words</code> list are present. If there is, it will put a <code>*</code> character in between each letter of the matching string.</p>

<p>E.g. the output would be</p>

<p><code>Hello w*o*r*l*d how are y*o*u?</code> since both <code>world</code> and <code>you</code> are in the list.</p>

<p>Passing <code>"Hello"</code> would simply return back the unmodified string <code>"Hello"</code> because there is nothing in the string that is inside <code>words</code>.</p>

<p>How would I go about doing this? I have tried hardcoding a .replaceAll() call on the string for each word, but then I lose the casing of the string. E.g. <code>"Hello world how are you?"</code> became <code>"hello w*o*r*l*d how are y*o*u?"</code></p>
