ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string to array

Solved!
Go to solution

    hello all LabView Pundits

 

i have a string of binary numbers. (but the LV has considered them as deciamal, i think).

I want to convert them to a 1-D array such that each element of the array has each digit of the string.

 

in the sense:

String : 1010

 

i want the array to be a 1-D array such that each of the element in the array has one each of the above digits.

 

thankx in advance

more kudos to give 🙂

 

PS: will using "spreadsheet string to array" help??? 

Many more Kudos to give:)
0 Kudos
Message 1 of 6
(4,469 Views)
Solution
Accepted by nikhilvastarey

Here's one possibility, assuming the string is clean and does not contain any unexpected characters.

 

Convert the String to a byte array and subtract 48.

 

Message Edited by altenbach on 01-01-2009 10:53 PM
Message 2 of 6
(4,458 Views)

Hi!

 

I don't understand what is the meaning of substract 48. Could you explain, please??

 

Thanks.

0 Kudos
Message 3 of 6
(3,602 Views)

I hope this link is enough for you to answer your question.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 6
(3,599 Views)

Ok, but it's easier to say that 48 is the ASCII code of the 0 symbol, right?

 

Anyway tnks.

0 Kudos
Message 5 of 6
(3,594 Views)

Hi kantabra,

 

one should think you already got the point as you asked (basically) the same in that thread one hour earlier...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(3,589 Views)