utf8PointerToOffset

fun utf8PointerToOffset(str: String, pos: String): <Error class: unknown class>

Converts from a pointer to position within a string to an integer character offset.

Since 2.10, this function allows @pos to be before @str, and returns a negative offset in this case.

Return

the resulting character offset

Parameters

str

a UTF-8 encoded string

pos

a pointer to a position within @str