Equal
String
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. Returnstrue
if the input strings are equal, andfalse
otherwise.
Configuration
This node has no configuration options.
Usage
To use the Equal (String) node:
- Connect the first string to compare to the
a
input. - Connect the second string to compare to the
b
input. - The
result
output will emittrue
if the input strings are equal, andfalse
otherwise.
Example
Here’s an example of how to use the Equal (String) node in a spell:
In this example:
- 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
false
since “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.