Consider having the following string and it's numerical value:
You then allow the user to type in to a textbox: 1|17|7|19
, how would I be able to highlight the text as follows:
I can have it work when calculating in spaces and paragraphs, but when I completely remove all white space and new lines (e.g. "Thisissomedummytext") I cannot work out how I would go about achieving this.
EDIT
This is what I have so far, it takes into account spaces and new lines (nl's count as 1 char).