LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String comparison troubles

Hello, attached is an example vi of a problem I'm facing. Can someone tell me why these two strings will not ring a true result?

Thanks,
Candice


Message Edited by Candice on 06-05-2008 02:15 PM
0 Kudos
Message 1 of 4
(2,673 Views)
Cancel that request for now; thanks.
0 Kudos
Message 2 of 4
(2,671 Views)

Dear candice,

Glad to hear that problem solved. But still if you post what troubled you and how you overcome it, the forum users got much more benefitted by that.

Thanks,

Mathan

Message 3 of 4
(2,641 Views)
The problem I was running into was as follows:

An array of strings was passed into a for loop with indexing on.  At each turn of the for loop, that particular string was compared to a single string until a match was found.  The problem I found was that although the strings looked identical, the "equal" comparison was continually ringing a false result.

I'm not sure how, but it seemed to me that there were some extra whitespaces on one or the other string; I could not see them so it was a "blind" guess.  Therefore, I just introduced the "Trim Whitespace" function on the String Palette to both strings and my problem is temporarily solved.  I suppose copying those strings into a text editor and looking to see where the extra whitespace(s) were coming from, should be my next course of action, in the interest of thoroughness.


Message Edited by Candice on 06-07-2008 10:38 PM

Message Edited by Candice on 06-07-2008 10:38 PM
Message 4 of 4
(2,601 Views)