コード例 #1
0
        public static RealWorldPhone Split(string s)
        {
            string[] ss = s.Split("-".ToCharArray());
            if (ss.Length != 2)
            {
                return(null);
            }
            string errMsg   = "";
            ushort areaCode = 0;
            int    phone    = 0;

            if (!ushort.TryParse(ss[0], out areaCode))
            {
                return(null);
            }
            if (!int.TryParse(ss[1], out phone))
            {
                return(null);
            }
            RealWorldPhone ret = RealWorldPhone.New(ref errMsg, areaCode, phone);

            return(ret);
        }
コード例 #2
0
 public static bool Check(RealWorldPhone phone, ref bool isMobile)
 {
     return(Check(phone.ToString(), ref isMobile));
 }
コード例 #3
0
 public static string Combin(RealWorldPhone phone)
 {
     return(string.Format("{0}-{1}", phone.mAreaCode, phone.mPhoneNum));
 }