LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string and substring from an array of string

Hi Agyna,

 

Indeed as Mike says.  It's a VI snippet.  It means it's a normal image, but then with some Meta-information about the code.  You can drag the png-file onto a block diagram and then you have the VI.

 

Here is a link that explains how to create a VI snippet

 

Here is some more information about it.

 

Kind regards,

 

Bjorn

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 21 of 24
(868 Views)

Hi Bjorn,

 

Thank you, this works. The only thing is I have to change the delimiter from ",\s" to just a space. and it works fine. But I am running into another issue. The problem I am having is that if I put 2 "spaces" between strings or is I add one more space at the end of the incoming strings, it considers the second space as string and of course, it reports "not found". How to get rid of any extra space.

 

How to get the program to disgard any extra space in the incoming string?

 

For example I have "washington" " "dallas" "seattle" ". It reports "shington ington washington notfound las  seat notfound

Note that " " = space

Thanks for your help.

Agyna

0 Kudos
Message 22 of 24
(856 Views)

What you could do is a check in the first for loop whether the value from you input string is empty.  If the value is empty, you dont have to execute what is inside the 1st for-loop.  If the string is empty, don't do anything, if not, execute the code.

 

StringInArray_Snippet.pngStringInArray_Snippet.png

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 23 of 24
(853 Views)

Thank you Bjorn, that solves it. I learned a lot from you. thanks a lot.

 

Agyna

0 Kudos
Message 24 of 24
(845 Views)