lengthvalidate.cs

来自「改程序能够查询课程表」· CS 代码 · 共 39 行

CS
39
字号
using System;
using System.Collections.Generic;
using System.Text;

namespace Common.Utility.Validate{
    public class LengthValidate {
        public static bool IsLongerThan(string source, int length) {
            if (source == null) {
                return true;
            }

            return source.Length > length;
        }
        public static bool IsNonShorterThan(string source, int length) {
            if (source == null) {
                return true;
            }

            return source.Length >= length;
        }

        public static bool IsShorterThan(string source, int length) {
            if (source == null) {
                return true;
            }

            return source.Length < length;
        }

        public static bool IsNonLongerThan(string source, int length) {
            if (source == null) {
                return true;
            }

            return source.Length <= length;
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?