LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search token in string.

Solved!
Go to solution

Hi everyone,

 

I was wondering if there is any VI that does the function of searching a particular Substring in a string and gives a Boolean ( True / False ) as a output. If found, give a true. Cannot be found, give a false.

 

Thanks!~

0 Kudos
Message 1 of 2
(2,550 Views)
Solution
Accepted by topic author saintalan94

You'll not get directly a BOOLEAN output, but for this sort of requirements there are different functions available and each of these functions give an output called 'Offset of Match' (or 'Offset Past Match' in some functions).

 

Now based on the requirement you can select anyone of the following:

1. Search/Split String: (Simplest function and fastest)

Search-Split String.PNG

 

2. Match Pattern: (Powerful and slower)

Match Pattern.PNG

 

3. Match Regular Expression: (Powerful most and slowest)

Match Regular Expression.PNG

 

Now while using any of these functions if this particular output 'Offset of Match' (or 'Offset Past Match' in some functions) gives '-1' (negative 1) it means that the substring (token) is not found in the main string, so a simple check will give you, your desired functionality.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


Message 2 of 2
(2,543 Views)