LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert string into array of char

Solved!
Go to solution

What's the best way to convert a string into an array of characters?

 

Thanks.

Message 1 of 5
(28,546 Views)
Solution
Accepted by topic author VI_Joe
Message 2 of 5
(28,545 Views)

@Vi Joe wrote:

What's the best way to convert a string into an array of characters?


Define "array of characters", it is ambiguous.

 

If you mean an array of U8 numerics, go with "string to byte array" as mentioned above.

If you want an array where each element is a single character string, you could do something like the following.

 

Message 3 of 5
(28,538 Views)

Type Cast Man would beat me up for saying this, so you didn't hear this from me:  I benchmarked this process fairly heavily for the OpenG folks and found that the simple String Subset method in a For Loop was the fastest.

0 Kudos
Message 4 of 5
(28,524 Views)

OpenG has a VI which implements this functionality. You can download OpenG from here: https://lumen.ni.com/nicif/us/evaltlktopeng/content.xhtml

 

To see the discussion regarding the implementation of the "String to Character Array" you can click here: http://lavag.org/topic/14873-string-to-character-array-string-package/

Message 5 of 5
(28,518 Views)