LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I search for a string and if it found then return true and false if not found?

how can I search for a string and if it found then return true and false if not found?
0 Kudos
Message 1 of 4
(2,967 Views)
Se;

To search for a substring in a string (let say, the string is "Have a good day" and you are searching for the word "good"), you can use the VI Search/Split String located in the "Strings -> Additional String Functions" palette. Test the value of the output "offset of match". If the value is less than 0, then the substring is not part of the string.

However, "search for a string" can mean several things. We can provide you with better advice if you can provide an example of what you want.

Regards;
Enrique
www.vartortech.com
Message 2 of 4
(2,967 Views)
Enrique,

This is an example:
string = 4 this is just an example

searchString1=This
----
This is what I wanted to do

searchString1 in string
if searchString1 is found then
return true
else return false
0 Kudos
Message 3 of 4
(2,967 Views)
I know how to do it now. Thanks
0 Kudos
Message 4 of 4
(2,967 Views)