LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string to boolean array

All i need to do is transform a string to boolean array.  if there is a character in the string location then a true will occur in the boolean array.

example

_ _ 1 0 1 _ _  string array

F F T T T F F  output boolean

i tried to do a string to numeric conversion and then a number to boolean array conversion but was having problems.  thank you, attached is what i tried
0 Kudos
Message 1 of 4
(6,467 Views)

Is this what you're looking for?

-D

Message Edited by Darren on 08-21-2006 12:15 PM

Message 2 of 4
(6,461 Views)
Thats exactly it.  thank you
0 Kudos
Message 3 of 4
(6,455 Views)


@lfoitek wrote:
All i need to do is transform a string to boolean array.  if there is a character in the string location then a true will occur in the boolean array.


Well, your example input is an array of strings, not a string. Here each array element could be an empty string or the collected works of shakespeare. 😉

Darren's solution will give you a TRUE, if an array element contains at least one character. Here's an alternative that does the same in fewer steps.

For a complete solution, we would also need to know your definition of character. Any ASCII code, including non-printable characters? Only letters A-z? Only single digit numbers?

Message Edited by altenbach on 08-21-2006 10:37 AM

0 Kudos
Message 4 of 4
(6,446 Views)