zoukankan      html  css  js  c++  java
  • Delphi 判断字符串是否是数字、大小字母、小写字母、纯字母组成

    Delphi 判断字符串是否是数字、大小字母、小写字母、纯字母组成

     //判断字符串是否是数字 ,返回布尔值
    function IsNumberic(Vaule:String):Boolean;  
    var
    i:integer;
    begin
    result:=true;   //设置返回值为 是(真)
    Vaule:=trim(Vaule);  //去空格
      for i:=1 to length(Vaule) do  //准备循环
        begin
          if not (Vaule[i] in ['0'..'9']) then  //如果Vaule的第i个字不是0-9中的任一个
            begin
              result:=false;  //返回值 不是(假)
              exit;  //退出函数
            end;
        end;
    end;
    
    //判断字符串是否是大写字母,返回布尔值
    function IsUpperCase(Vaule:String):Boolean;   
    var
    i:integer;
    begin
    result:=true;  //设置返回值为 是
    Vaule:=trim(Vaule);   //去空格
      for i:=1 to length(Vaule) do   //准备循环
        begin
          if not (Vaule[i] in ['A'..'Z']) then  //如果Vaule的第i个字不是A-Z中的任一个
            begin
              result:=false;  //返回值 不是
              exit;  //退出函数
            end;
        end;
    end;
    
     //判断字符串是否是小写字母,返回布尔值
    function IsLowerCase(Vaule:String):Boolean; 
    var
    i:integer;
    begin 
    result:=true;   //设置返回值为 是
    Vaule:=trim(Vaule);   //去空格
      for i:=1 to length(Vaule) do   //准备循环
        begin
          if not (Vaule[i] in ['a'..'z']) then   //如果Vaule的第i个字不是a-z中的任一个
            begin
              result:=false;   //返回值 不是
              exit;   //退出函数
            end;
        end;
    end;
    
     //判断 字符串 是不是由字母组成,返回布尔值
    function IsEnCase(Vaule:String):boolean;   
    var
    i:integer;
    begin 
    result:=true;   //设置返回值为 是
    Vaule:=trim(Vaule);   //去空格
      for i:=1 to length(Vaule) do   //准备循环
        begin
          if (not (Vaule[i] in ['A'..'Z'])) or
             (not (Vaule[i] in ['a'..'z'])) then   //如果Vaule的第i个字不是A-Z或者a-z中的任一个
            begin
              result:=false;   //返回值 不是
              exit;   //退出函数
            end;
        end;
    end;
    

      

    创建时间:2020.07.06  更新时间:

  • 相关阅读:
    最强JAVA核心技术群
    脚本加载整个文件夹的jar到环境变量
    TTS 中文转制 google
    vue+webpack+sass
    springboot入门程序
    vue+ui
    正则表达式
    vue全家桶router、vuex、axios
    vue基础
    springboot获取自定义配置的值、获取类型安全的自定义配置的值和profile配置
  • 原文地址:https://www.cnblogs.com/guorongtao/p/13254539.html
Copyright © 2011-2022 走看看