Comparing Strings

LabVIEW 2018 Help


Edition Date: March 2018
Part Number: 371361R-01
View Product Info

DOWNLOAD (Windows Only)


LabVIEW 2016 Help
LabVIEW 2017 Help
LabVIEW 2018 Help
LabVIEW 2019 Help
LabVIEW 2020 Help

Comparison functions compare strings according to the values of the ASCII character codes. The Comparison functions compare strings one element at a time starting with the 0th element until they encounter an inequality or until one string ends. The functions treat the longer string as greater than the shorter string.

For example, a (with a decimal value of 97) is greater than A (65), which is greater than the numeral 0 (48), which is greater than the space character (32). LabVIEW compares characters one by one from the beginning of the string until an inequality occurs, at which time the comparison ends. For example, LabVIEW evaluates the strings abcd and abef until it finds c, which is less than the value of e. The presence of a character is greater than the absence of one. Thus, the string abcd is greater than abc because the first string is longer.

The functions that test the category of a string character, such as the Decimal Digit? and Printable? functions, evaluate only the first character of the string.

WAS THIS ARTICLE HELPFUL?

Not Helpful