更新时间:2024-07-25 GMT+08:00
分享

字符集判断

str_isalnum

判断字符串是否仅由字母和数字组成。

  • 函数格式
    str_isalnum(value)
  • 参数说明

    参数名称

    参数类型

    是否必填

    说明

    value

    任意(自动转为String)

    需要被检测的字符串。

  • 返回结果

    true/false。

  • 函数示例
    • 测试数据
      {
       "value": "ltsv5"
      }
    • 加工规则
      e_set("str_isalnum", str_isalnum(v("value")))
    • 加工结果
      value: ltsv5 
      str_isalnum: true

str_isalpha

判断字符串是否仅由字母组成。

  • 函数格式
    str_isalpha(value)
  • 参数说明

    参数名称

    参数类型

    是否必填

    说明

    value

    任意(自动转为String)

    需要被检测的字符串

  • 返回结果

    true/false。

  • 函数示例
    • 测试数据
      {
       "value": "ltsv5"
      }
    • 加工规则
      e_set("str_isalpha", str_isalpha(v("value")))
    • 加工结果
      value: ltsv5 
      str_isalpha: false

str_isascii

判断字符串是否在ASCII中。

  • 函数格式
    str_isascii(value)
  • 参数说明

    参数名称

    参数类型

    是否必填

    说明

    value

    任意(自动转为String)

    需要被检测的字符串。

  • 返回结果

    true/false。

  • 函数示例
    • 测试数据
      {
       "value": "{ltsv5}#@"
      }
    • 加工规则
      e_set("str_isascii", str_isascii(v("value")))
    • 加工结果
      value: {ltsv5}#@
      str_isascii: true

str_isdecimal

判断字符串是否仅包含十进制字符。

  • 函数格式
    str_isdecimal(value)
  • 参数说明

    参数名称

    参数类型

    是否必填

    说明

    value

    任意(自动转为String)

    需要被检测的字符串。

  • 返回结果

    true/false。

  • 函数示例
    • 测试数据
      {
       "value": "111"
      }
    • 加工规则
      e_set("str_isdecimal", str_isdecimal(v("value")))
    • 加工结果
      value: 111
      str_isdecimal: true

str_isdigit

判断字符串是否仅由数字组成。

  • 函数格式
    str_isdigit(value)
  • 参数说明

    参数名称

    参数类型

    是否必填

    说明

    value

    任意(自动转为String)

    需要被检测的字符串。

  • 返回结果

    true/false。

  • 函数示例
    • 测试数据
      {
       "value": "111"
      }
    • 加工规则
      e_set("str_isdigit", str_isdigit(v("value")))
    • 加工结果
      value: 111
      str_isdigit: true

str_isidentifier

字符串是否是有效的Python标识符,也可以用来判断变量名是否合法。

  • 函数格式
    str_isidentifier(value)
  • 参数说明

    参数名称

    参数类型

    是否必填

    说明

    value

    任意(自动转为String)

    需要被检测的字符串。

  • 返回结果

    true/false。

  • 函数示例
    • 测试数据
      {
       "key": "int"
      }
    • 加工规则
      e_set("str_isidentifier", str_isidentifier(v("key")))
    • 加工结果
      key: int
      str_isidentifier: true

str_islower

判断字符串是否由小写字母组成。

  • 函数格式
    str_islower(value)
  • 参数说明

    参数名称

    参数类型

    是否必填

    说明

    value

    任意(自动转为String)

    需要被检测的字符串。

  • 返回结果

    true/false。

  • 函数示例
    • 测试数据
      {
       "key": "lower"
      }
    • 加工规则
      e_set("str_islower", str_islower(v("key")))
    • 加工结果
      key: lower 
      str_islower: true

str_isnumeric

判断字符串是否由数字组成。

  • 函数格式
    str_isnumeric(value)
  • 参数说明

    参数名称

    参数类型

    是否必填

    说明

    value

    任意(自动转为String)

    需要被检测的字符串。

  • 返回结果

    true/false。

  • 函数示例
    • 测试数据
      {
       "key": "123W"
      }
    • 加工规则
      e_set("str_isnumeric", str_isnumeric(v("key")))
    • 加工结果
      key: 123W 
      str_isnumeric: false

str_isprintable

判断字符串中是否所有字符都是可打印字符。

  • 函数格式
    str_isprintable(value)
  • 参数说明

    参数名称

    参数类型

    是否必填

    说明

    value

    任意(自动转为String)

    需要被检测的字符串。

  • 返回结果

    true/false。

  • 函数示例
    • 测试数据
      {
        "key": "@#11!"
      }
    • 加工规则
      e_set("str_isprintable",  str_isprintable(v("key")))
    • 加工结果
      key: @#11!
      str_isprintable: true

str_isspace

判断字符串是否仅由空格字符组成。

  • 函数格式
    str_isspace(value)
  • 参数说明

    参数名称

    参数类型

    是否必填

    说明

    value

    任意(自动转为String)

    需要被检测的字符串。

  • 返回结果

    true/false。

  • 函数示例
    • 测试数据
      {
        "key": "@#11!"
      }
    • 加工规则
      e_set("str_isspace",  str_isspace(v("key")))
    • 加工结果
      key: @#11!
      str_isspace: truefalse

str_istitle

判断字符串中所有单词的拼写首字母是否为大写,且其他字母为小写。

  • 函数格式
    str_istitle(value)
  • 参数说明

    参数名称

    参数类型

    是否必填

    说明

    value

    任意(自动转为String)

    需要被检测的字符串。

  • 返回结果

    true/false。

  • 函数示例
    • 测试数据
      {
       "key":"Lts Is A Log Service"
      }
    • 加工规则
      e_set("str_istitle", str_istitle(v("key")))
    • 加工结果
      key: Lts Is A Log Service 
      str_istitle: true

str_isupper

判断字符串中所有的字母是否都为大写。

  • 函数格式
    str_isupper(value)
  • 参数说明

    参数名称

    参数类型

    是否必填

    说明

    value

    任意(自动转为String)

    需要被检测的字符串。

  • 返回结果

    true/false。

  • 函数示例
    • 测试数据
      {
       "key":"LTS"
      }
    • 加工规则
      e_set("str_isupper", str_istitle(v("key")))
    • 加工结果
      key: LTS 
      str_isupper: true

str_uuid

随机生成UUID。

  • 函数格式
    str_uuid(lower=true)
  • 参数说明

    参数名称

    参数类型

    是否必填

    说明

    lower

    Boolean

    生成的UUID中的字母是否是小写。默认为true表示小写。

  • 返回结果

    true/false。

  • 函数示例
    • 测试数据:无
    • 加工规则
      e_set("UUID", str_uuid())
    • 加工结果
      UUID: 1acf7e1d-5a6b-4267-b7c1-874c8b70745d

相关文档