Use regular expression. Take a look at Pattern and Matcher classes.
SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35253
7
posted
0
Something like the following may do the trick. You'll need to add a loop to deal with the case when findStr can occur more than once in targetStr. (The indices may be off, but you get the idea.)