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: Returnstrueifais exactly equal tob.a != b: Returnstrueifais not exactly equal tob.a IN b: Returnstrueifaoccurs as a substring ofb.a MATCH REGEX(b): Returnstrueifamatches the regular expression supplied inb.a BEGINSWITH b: Returnstrueifastarts with the stringb.a ENDSWITH b: Returnstrueifaends with the stringb.
- case_sensitive (
BOOLEAN, required, defaulttrue): Controls whether the comparison distinguishes uppercase and lowercase characters. Whentrue, comparisons are case-sensitive. Whenfalse, case is ignored for string comparisons and regular expression matching.
Outputs
- BOOLEAN: The result of the selected string comparison. Outputs
truewhen the operation succeeds andfalseotherwise.
Usage Notes
- Operation labels are written from the perspective of
aandb. For example,a BEGINSWITH bchecks whetherbis a prefix ofa, not the reverse. a IN bmay be surprising at first: it checks whether the value inais contained inside the value inb.- For
a MATCH REGEX(b), the pattern is taken fromband the text being tested isa. The regex syntax follows the regular expression engine used by the node. - Set
case_sensitivetofalsewhen 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.