Identifying indices of non-delimited characters in a string, supporting greater than 1 length of delimiters
Some off the cuff comments:
It would help if you provided a compilable class rather than a somewhat misleading snippet.
Your search would be better as a separate method.
I don't see why you search in this way when String.indexof(String) and String.substring(int) exist.
Have you a clear understanding of how you would handle overlapping delimiters? If your delimiter is &quot;!!&quot;, how is &quot;abc!!!def&quot; to be interpreted?