static convertCharacterCountToIndexPosition(characterCount) {
        return Math.max(characterCount, characterCount - 1);
    }
Return the index that can be used to set the caret position.
This takes into account that the position is starting at '0', not 1.

@param {int} characterCount
@returns {number}