Exemplo n.º 1
0
        /// <summary>
        /// Returns the index that is offset <paramref name="codePointOffset"/> code points from
        /// <paramref name="index"/>.
        /// </summary>
        /// <param name="text">This <see cref="StringBuilder"/>.</param>
        /// <param name="index">The index to calculate the offset from.</param>
        /// <param name="codePointOffset">The number of code points to count.</param>
        /// <returns>The index that is <paramref name="codePointOffset"/> code points away from <paramref name="index"/>.</returns>
        /// <seealso cref="Character"/>
        /// <seealso cref="Character.OffsetByCodePoints(char[], int, int, int, int)"/>
        public static int OffsetByCodePoints(this StringBuilder text, int index, int codePointOffset)
        {
            var chars = text.GetChars();

            return(Character.OffsetByCodePoints(chars, 0, chars.Length, index,
                                                codePointOffset));
        }
Exemplo n.º 2
0
 public static int OffsetByCodePoints(this string seq, int index,
                                      int codePointOffset)
 {
     return(Character.OffsetByCodePoints(seq, index, codePointOffset));
 }