Equal (String)
The Equal (String) node compares two input strings and outputs a boolean value indicating whether they are equal.Inputs
a(string): The first string to compare. Default value is an empty string.b(string): The second string to compare. Default value is an empty string.
Outputs
result(boolean): The result of the equality comparison. Returnstrueif the input strings are equal, andfalseotherwise.
Configuration
This node has no configuration options.Usage
To use the Equal (String) node:- Connect the first string to compare to the
ainput. - Connect the second string to compare to the
binput. - The
resultoutput will emittrueif the input strings are equal, andfalseotherwise.
Example
Here’s an example of how to use the Equal (String) node in a spell:- Two string input nodes provide the strings “hello” and “world”.
- The Equal (String) node compares these two strings.
- The output boolean node emits the result of the comparison, which in this case would be
falsesince “hello” does not equal “world”.
Best Practices
- Ensure that both inputs are properly connected before running the spell.
- Keep in mind that the comparison is case-sensitive. “Hello” and “hello” will be considered unequal.
- If you need to compare strings while ignoring case, consider using a string manipulation node to convert both strings to the same case before the comparison.
Common Issues
- Forgetting to connect one or both inputs will result in the node comparing against empty strings, which may lead to unexpected results.
- Attempting to compare non-string values will cause an error. Ensure that any values passed to this node are explicitly cast as strings.
