c#判断字符串为英文字母

2023-05-10 13:39 1147 浏览

public static bool IsEn(string input)  //判断字符串是不是全部为英文字母
        {
            string pattern = @"^[A-Za-z]+$";
            Regex regex = new Regex(pattern);
            return regex.IsMatch(input);
        }
c#
分享:
上一篇 下一篇
暂无资料
相关内容0
  • c#判断字符串是不是全部为数字
    public static bool IsNum(string input) //判断字符串是不是全部为数字 { string pattern = @"^[0-9]+$"; Regex regex = new Regex(pattern); return regex.IsMatch(input); }
  • c#获取鼠标的位置和对应的句柄
    [DllImport("user32.dll")]static extern IntPtr WindowFromPoint(Point Point); [DllImport("user32.dll")]static extern bool GetCursorPos(out Point lpPoint);[DllImport("user32.dll")]static extern int SetCursorPos(int x, int y); Point p; if (GetCursorPos(out p)) { text=p.X + "." + p.Y; //返回鼠标位置坐标 } Text = WindowFromPoint(p).ToString (); //返回坐标处的句柄 SetCursorPos(0,0); //设置鼠标坐标
  • c# 获取文件大小
    2个方法得到并返回文件大小, 第一个方法得到文件大小,并自动返回与文件详细信息里面的显示一致 第二个方法得到文件大小,并自动按字节大小返回指定小数位数的大小信息 /// /// 方法一,得到文件大小,返回文件大小(与文件详细信息里的大小一致) /// /// 带路径的文件名 /// private static string GetFi0leSize(string filename) { string result = "";
相关推荐
程序设计
热门内容
  • c#获取鼠标的位置和对应的句柄
    [DllImport("user32.dll")]static extern IntPtr WindowFromPoint(Point Point); [DllImport("user32.dll")]static extern bool GetCursorPos(out Point lpPoint);[DllImport("user32.dll")]static extern int SetCursorPos(int x, int y); Point p; if (GetCursorPos(out p)) { text=p.X + "." + p.Y; //返回鼠标位置坐标 } Text = WindowFromPoint(p).ToString (); //返回坐标处的句柄 SetCursorPos(0,0); //设置鼠标坐标
  • [源码]PLC 推箱子 游戏
    介绍 本人是工控菜鸟,初学PLC编程。 最近一直在学习 小羽老师 的教学课程。 本程序是用WinCC7.5SP2 配合博图15.1 开发。WinCC只负责游戏画面的显示部分,其他功能逻辑的处理则全部由PLC来完成。(PLC设备是仿真的西门子1200系列的1214C) 本程序只是为了熟悉梯形图程序设计,只是为了编程而写的PLC程序,大佬们不要喷我! 截图 下载地址 PLC推箱子_源码.rar 相关软件
  • 卡通手绘芦荟绿色芦荟汁液美容院海报PNG免扣素材
    卡通手绘芦荟绿色芦荟汁液美容院海报PNG免扣素材 下载地址 142卡通手绘芦荟绿色芦荟汁液美容院海报PNG免扣素材.rar
  • c#判断字符串是不是全部为数字
    public static bool IsNum(string input) //判断字符串是不是全部为数字 { string pattern = @"^[0-9]+$"; Regex regex = new Regex(pattern); return regex.IsMatch(input); }
  • C#图形处理三种方式
    本代码通过彩色图象灰度化来介绍C#处理数字图像的3种方法,Bitmap类、BitmapData类和Graphics类是C#处理图像的的3个重要的类。 Bitmap主要要用于处理由像素数据定义的图像的对象,主要方法和属性如下:     GetPixel方法和SetPixel方法,获取和设置一个图像的指定像素的颜色。     PixelFormat属性,返回图像的像素格式。     Palette属性,获取
Tags标签
联系方式