title: Compare two string values and return its index in java
body: <p>I have two strings containing some hex values.</p>
  
  <pre><code>String One = "f9 d4 62 aa f9 d4 62 aa 74 10 99 8b";
  String Two = "3c 9c a7 e2 3c 9c a7 e2 b1 58 f9 d4";
  </code></pre>
  
  <p>Please note that the spaces in between the hex is generated by function that is converting binary to hex.Furthermore, the hex values are treated in pairs eg, f9 d4 is regarded as one pair.</p>
  
  <p>My question is - how can I return the index (in this case, substring value) of two similar pair in the two strings?
  The above example has f9 d4 in index 1 while the other String has it on index 6. So i want my output as (1,6) and (3,6).
  Any help or suggestion would be appreciated.  </p>