Find the index of a character. Supports escape characters and looking for the nth character in a string.