Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Comparing Strings

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

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.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit