How to split a sentence into two separate arrays
<pre><code>String input0 = "G1 and G2 are the founders of Microsoft.";
String input1 = "The swimming medals were won by G1 and G2";
</code></pre>

<p>I would like to parse the above strings and create 2 separate arrays (Note: G1, G2, G3, ... are placeholders for user input and would like to get them separately)</p>

<pre><code>e.g. for input0 the following arrays should be created array0 [G1, G2] and array1 [" and ", " is the founder of Microsoft."]
e.g for input1 the following arrays should be created array0 [G1, G2] and array1 ["The swimming medals were won by ", " and "]
</code></pre>

<p>I've tried using <code>indexOf</code> functions and <code>split</code>, but haven't been able to get it working properly so far.</p>
