1,

比较两个指定的 String 对象。

条件

小于零

strA 小于 strB。

strA 等于 strB。

大于零

strA 大于 strB。

实例:

if (string.Compare(beginDate.ToString("yyyyMMdd"), endDate.ToString("yyyyMMdd")) > 0)
            {
               throw new GSPException("开始日期不能大于结束日期", ErrorLevel.Info);
            }

 

String.IsNullOrEmpty 方法 (String)

指示指定的字符串是 null 还是 Empty 字符串。

返回值

Type: System.Boolean

null;否则为 false

 

实例:

if (string.IsNullOrEmpty(ds.Tables["RebatePolicy"].Rows[0]["RebateGuid"].ToString()))
               throw new GSPException("不是制单状态,不允许删除", ErrorLevel.Info);

 

相关文章:

  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
猜你喜欢
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2021-12-04
  • 2022-02-03
  • 2022-02-09
相关资源
相似解决方案