Ask HN: Is there a good way to identify locations within strings of text? - beesly
======
FroshKiller
For a single character, I like to provide an integer value of the number of
bytes (or characters, depending) offset from the beginning of the string.

For a substring, I provide the same starting offset plus another integer for
the length (again, in characters or bytes depending on context).

I think you'll find these are very popular approaches.

