LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to compare strings

Solved!
Go to solution

Hi i have gone through some examples for comparing the strings , but i am having a doubt.

 

The following are the two strings in need to compare 

 eg :  FE1122334455667788FE and FE 11 22 33 44 55 66 77 88 FE 

 

i have used the basic Equal expression as well as the Match Pattern Epression , but i am not getting a proper output ? Is it because of the spaces , if so how can i compare only the strings by eliminating the spaces ?

 

If someone can help that will be great .

 

cheers Raj 

0 Kudos
Message 1 of 5
(3,704 Views)

An old method:

 

 FilterString.jpg

Derivate of  "Search and Replace Pattern" with option replace All?=True, available in Palette String >> Additional String Functions

Message Edité par J.DECHET le 07-21-2009 12:35 PM
Message Edité par J.DECHET le 07-21-2009 12:36 PM
Message 2 of 5
(3,700 Views)
Solution
Accepted by topic author electroncis

Hi Raj, Yes. You were getting the result as not equal because of the presence of space in your second string.

 

You can use the function named, Search and Replace to identify space character and replace all of them with null character. Once you do that and the result of this you compare, you will definitely get the result as equal.

 

I have made an example code for that and the screenshot of that is attached with this post.

 

Regards,

Sundar Ganesh

Message 3 of 5
(3,674 Views)
Just to know, the soluce from 'sundarganesh' is better because his used native function is optimized Smiley Wink.
0 Kudos
Message 4 of 5
(3,663 Views)

Dear Sundar Ganesh and J.DECHET

 

A very thank for both of you for helping me to solve the problem

 

The example given by Sundar is what i was looking for . Thank you once again 

 

regards

RajSmiley Happy

0 Kudos
Message 5 of 5
(3,646 Views)