LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string and substring from an array of string

hello,

 

I really need some help here, I have a input string coming in and an array of words coming from the table. I need to be able to find the exact matching string and its longest subtring. For example if my input is washington, the match will be washington which is at #1 in the table and there 2 bustrings of Washington in the table, shington and ington. So then my program will report the longest substring; which is shington.

 

remember the program is reporting the exact match and the longest substring of the match.

 

Thank you,

Yaka.

 

 

 

  

Download All
0 Kudos
Message 1 of 24
(4,848 Views)

How's this?

 

substr[1].png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 2 of 24
(4,827 Views)

 


@jcarmody wrote:

How's this?

 

 


I think you just did his homework. This question sounded like a typical homework assignment.

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 3 of 24
(4,820 Views)

Thanks a lot. By the way I am not a student. I am working on testing wifi stuffs and need to generate some test definition files....

 

-Yaka

0 Kudos
Message 4 of 24
(4,816 Views)

@Mark Yedinak wrote:

 

I think you just did his homework. 


😞

 

I hope it's not the entire solution - the posted VI had a 2D array and I only used one.  I worried enough that I put a passive-aggressive string in the array.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 5 of 24
(4,812 Views)

@yaka wrote:

Thanks a lot. By the way I am not a student. [...]


 

 

🙂 Does my snippet help?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 6 of 24
(4,806 Views)

 


@yaka wrote:

Thanks a lot. By the way I am not a student. I am working on testing wifi stuffs and need to generate some test definition files....

 

-Yaka


 

For future reference you may want to state that in your original post. To be honest I didn't post a solution because I did get the impression this was a homework assignment. We do see that on a regular basis here on the forums.

 

I'm curious, what type of WiFi testing are you doing? Most of my testing is focused on networking and network protocols.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 7 of 24
(4,805 Views)

Sorry but I am interested into this subject.

 

What if I have to search for some strings for in a series of incoming string. for example I have "washington dallas seattle san jose" coming in and my table content "ington shington vancouver". How could I find ington and shington that are substrings of washington. Please my incoming string is a series of strings.

 

I am using substrings here but for the system I am building I am using a binary system for eg. 000011 11001 110001

 

Thanks,

agy

0 Kudos
Message 8 of 24
(4,756 Views)

Agyna,

 

Can't you just buffer all your characters into one string and wait untill you have everything?

 

In your example it looks like not all data is in there : my table content "ington shington vancouver"

 

I think you're making it harder on yourself then needed.  Where are you getting this data from?

 

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 9 of 24
(4,728 Views)

My data are just in the table where I have I bunch of substrings including ington, shington....

But I need to be able to detect those substring for each corresponding string input.

I am looping thru my input " washington dallas seattle....) so each time for example washington shows up,  its substrings (ington and shington should be detected and send to output.

 

Please I need some help with this.

 

 

Thank you,

agy.   

0 Kudos
Message 10 of 24
(4,722 Views)