跳转至

String contains(字符串包含(String contains))

Supported in: Batch, Faster, Streaming

Expression categories: Boolean, String

Declared arguments

  • Expression: Expression to compare.
    Expression\
  • Ignore case: Boolean to decide if comparison should be case-sensitive or not.
    Literal\
  • Value: Value to compare against.
    Expression\

Output type: Boolean

Examples

Example 1: Base case

Argument values:

  • Expression: ... Hello world
  • Ignore case: false
  • Value: hello

Output: false


Example 2: Base case

Argument values:

  • Expression: ... Hello world
  • Ignore case: false
  • Value: Hello

Output: true


Example 3: Base case

Argument values:

  • Expression: ... Hello world
  • Ignore case: true
  • Value: hello

Output: true


Example 4: Null case

Argument values:

  • Expression: null
  • Ignore case: false
  • Value: null

Output: false


Example 5: Null case

Argument values:

  • Expression: null
  • Ignore case: false
  • Value: Hello

Output: false


Example 6: Null case

Argument values:

  • Expression: hello world
  • Ignore case: false
  • Value: null

Output: false



中文翻译

字符串包含(String contains)

支持环境:批处理(Batch)、快速处理(Faster)、流处理(Streaming)

表达式类别: 布尔型(Boolean)、字符串(String)

声明的参数

  • 表达式(Expression): 待比较的表达式。
    表达式\<String>
  • 忽略大小写(Ignore case): 用于决定比较是否区分大小写的布尔值。
    字面量\<Boolean>
  • 值(Value): 用于比较的目标值。
    表达式\<String>

输出类型: 布尔型(Boolean)

示例

示例1:基础情况

参数值:

  • 表达式(Expression): ... Hello world
  • 忽略大小写(Ignore case): false
  • 值(Value): hello

输出: false


示例2:基础情况

参数值:

  • 表达式(Expression): ... Hello world
  • 忽略大小写(Ignore case): false
  • 值(Value): Hello

输出: true


示例3:基础情况

参数值:

  • 表达式(Expression): ... Hello world
  • 忽略大小写(Ignore case): true
  • 值(Value): hello

输出: true


示例4:空值情况

参数值:

  • 表达式(Expression): null
  • 忽略大小写(Ignore case): false
  • 值(Value): null

输出: false


示例5:空值情况

参数值:

  • 表达式(Expression): null
  • 忽略大小写(Ignore case): false
  • 值(Value): Hello

输出: false


示例6:空值情况

参数值:

  • 表达式(Expression): hello world
  • 忽略大小写(Ignore case): false
  • 值(Value): null

输出: false