首页 > 其他 > 详细

Code-Validator:验证邮政编码

时间:2020-04-12 15:57:49      阅读:61      评论:0      收藏:0      [点我收藏+]
ylbtech-Code-Validator:验证邮政编码

 

1.返回顶部
1、
using System;

namespace Sp.Common
{
    public class ValidatorHelper
    {
        /// <summary>  
        /// 验证邮政编码  
        /// </summary>  
        /// <param name="input">待验证的字符串</param>  
        /// <returns>是否匹配</returns>  
        public static bool IsZipCode(string input)
        {
            //string pattern = @"^\d{6}$";  
            //return IsMatch(input, pattern);  
            if (input.Length != 6)
                return false;
            int i;
            if (int.TryParse(input, out i))
                return true;
            else
                return false;
        }

    }
}
2、
2.返回顶部
 
3.返回顶部
 
4.返回顶部
 
5.返回顶部
 
 
6.返回顶部
 
技术分享图片 作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

Code-Validator:验证邮政编码

原文:https://www.cnblogs.com/storebook/p/12685672.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!