Example Code

String Compare with 'Don't Care' Characters

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

Coding that exemplifies how compare two strings with the ability of ignoring a specific character.

 

Description

This code will compare both strings to verify if they are equal in size. If they are, then we compare each character of both string controls to verify if they are equal. If they are not, we still have the option to verify if one of the strings' character is the one we might ignore. It at any moment the characters don't match, the VI will stop with an off LED.


Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code
1. Insert two strings
2. Select the character that can be ignored
3. Run the VI

 

Additional Information or References

Snippet.png

Tanya Visser
National Instruments
LabVIEW Group Manager

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Ting1224
NI Employee (retired)
on

It saves me a lot of time to figure out how to use * to represent all characters.

Thank you very much.