Find the closest index to the given position.
Index of the character. The index may be equal to character length.
See Implementation
Find the closest index to the given position.