Compare Strings (LogiX node)

From Neos Wiki
Jump to navigation Jump to search
This page contains changes which are not marked for translation.
Other languages:
Compare Strings
'Compare Strings' LogiX node
  String A
  String B
  StringComparison ComparisonType
  Int *

The Compare Strings node compares two strings and outputs an int depending on the value of each string.


This node takes two strings and a StringComparison as input, and it outputs an integer. The StringComparison can be any one of the StringComparer properties in C#. It is highly recommended to avoid using the CurrentCulture properties as this means the string may be parsed differently depending on the locale of the user.

If you are not using an Ordinal comparison, the node will output 1 or -1 depending on if the first string is longer or shorter than the second, respectively. If both strings are of equal length, it will compare each character in both strings and stop if two characters differ from the strings. If it stops, the node will output -1 or 1 depending on if the first string's character is of lower or higher value than the second string's character, respectively. Finally, if both strings are equal, it will output 0

If you are using an Ordinal comparison, the node will compare each character of both strings first. If it finds a difference between the two strings, it will output the integer difference between the first two differing characters. If both strings are equal up to the end of one, but one contains more characters than the other, it will output the difference between the length of the first input and the length of the second input. Finally, if both strings are equal, it outputs 0

If you are using a comparison that has IgnoreCase, the node will not account for case differences when comparing the two strings.


various interactions with the different ComparisonTypes

Node Menu

Back Characters Quick Format Special Characters + < >
× Capitalize Compare Strings Contains Empty String
Ends With Escape String Format Get Type Index Of String Is String Empty New Line
Null String Replace First Substring Replace Substring Reverse String Starts With String Insert String Join
String Length String Remove Strip RTF Tags Substring To Lower To String To Upper
Trim String Unescape String