LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Find a character in a string

Solved!
Go to solution

The Equal? function only returns true if the entire string matches.

 

Use a match pattern, a match regular expression, or a split string. Split String is probably the fastest, but it's also less flexible. It will return -1 if no P is found, an it's index if it is found.

0 Kudos
Message 31 of 37
(821 Views)

And if I put in a for loop? Because with the first thing I have done I am comparing with the letter "P" only the first string of the array.

I mean something like this

array4.PNG

0 Kudos
Message 32 of 37
(817 Views)
Solution
Accepted by topic author labview99

If each array element is just one letter, you shouldn't use the index array.

 

Simply compare the array with the letter, and you'll get an array of Booleans.

0 Kudos
Message 33 of 37
(796 Views)

Hi 99,

 

why did you again start a new thread for the very same problem?

Searching for A, B, or P doesn't make a big difference…

 

Have you read (and understand) the message on using an autoindexing FOR loop?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 34 of 37
(790 Views)

I got it| thank you so much!!

Best regards

0 Kudos
Message 35 of 37
(783 Views)

Yes, I got it

Thank you!

0 Kudos
Message 36 of 37
(782 Views)

Compare the P to the array.  You'll get an array of booleans.  Do OR Array Elements which will give you a True if one or more of the elements in the Array is a "P".

 

Have you taken the LabVIEW tutorials yet?

Do you have any prior programming experience before LabVIEW?

 

 

EDIT:  Sorry, I didn't see this had already been answered.  Just more confusion because of multiple basic questions scattered among numerous threads.

0 Kudos
Message 37 of 37
(766 Views)