EasyUse/Logic/Mathgenerated

Math String(mathStringOperation)

The Math String node performs boolean string comparisons and returns the result as a BOOLEAN.

math String Operation

BOOLEAN
a
STRING
b
STRING
operation
COMBO
case_sensitive
Easy Use

Description

The Math String node performs boolean string comparisons and returns the result as a BOOLEAN. Despite its "Math" category, it is intended for logic operations on text: you provide two strings, choose a comparison operation, and the node outputs true or false.

Inputs

  • a (STRING, required): The first string used in the comparison. It is the left-hand side of the selected operation.
  • b (STRING, required): The second string used in the comparison. It is the right-hand side of the selected operation and may also serve as a substring or regular expression pattern, depending on the operation.
  • operation (COMBO, required): The comparison to perform. Available operations:
    • a == b: Returns true if a is exactly equal to b.
    • a != b: Returns true if a is not exactly equal to b.
    • a IN b: Returns true if a occurs as a substring of b.
    • a MATCH REGEX(b): Returns true if a matches the regular expression supplied in b.
    • a BEGINSWITH b: Returns true if a starts with the string b.
    • a ENDSWITH b: Returns true if a ends with the string b.
  • case_sensitive (BOOLEAN, required, default true): Controls whether the comparison distinguishes uppercase and lowercase characters. When true, comparisons are case-sensitive. When false, case is ignored for string comparisons and regular expression matching.

Outputs

  • BOOLEAN: The result of the selected string comparison. Outputs true when the operation succeeds and false otherwise.

Usage Notes

  • Operation labels are written from the perspective of a and b. For example, a BEGINSWITH b checks whether b is a prefix of a, not the reverse.
  • a IN b may be surprising at first: it checks whether the value in a is contained inside the value in b.
  • For a MATCH REGEX(b), the pattern is taken from b and the text being tested is a. The regex syntax follows the regular expression engine used by the node.
  • Set case_sensitive to false when you need case-insensitive comparisons, such as matching "hello" against "Hello" or matching a regex pattern with mixed-case input.

Comments

Sign in with GitHub to join the discussion.

Loading comments…