Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="cp"></param>
        /// <returns></returns>
        public static char ToCharacter(this CharWithPosition cp)
        {
            char result = '\0';

            if (cp != null)
            {
                result = cp.Character;
            }

            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="cp"></param>
        /// <param name="ch"></param>
        /// <returns></returns>
        public static bool AreEqual(this CharWithPosition cp, char ch)
        {
            bool result = false;

            if (cp != null)
            {
                result = cp.Character == ch;
            }

            return(result);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 转换为位置,如果为null,则返回-1
        /// </summary>
        /// <param name="cp"></param>
        /// <returns></returns>
        public static int ToPosition(this CharWithPosition cp)
        {
            int result = -1;

            if (cp != null)
            {
                result = cp.Position;
            }

            return(result);
        }
Ejemplo n.º 4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="cp"></param>
 /// <param name="ch"></param>
 /// <returns></returns>
 public static bool AreNotEqual(this CharWithPosition cp, char ch)
 {
     return(AreNotEqual(cp, ch) == false);
 }