03-01-2016 10:46 AM
Hi
This is a really easy question but I want final string to have only the first two digits (cut off all the 0's). I cannot figure out what is the correct format string to use..
Thanks
Solved! Go to Solution.
03-01-2016 10:52 AM
Use the String to Byte Array on the String -> Conversion pallete.
03-01-2016 10:59 AM
I do not understand, can you show me an example?
Thanks
03-01-2016 11:02 AM
Actually, instead of trimming the string, right click the "zero" constant you're using to change format and choose "Representation --> U8" and that's probably the best way.
Basically, one letter is one byte, and the zero constant you have there is an I32, which is 4 bytes, generating the extra 6 zeroes.
03-01-2016 11:13 AM
That makes sense, but for another part of my code, I need to use string (just formatting a string, no conversions involved..)
Thanks
03-01-2016 11:17 AM - edited 03-01-2016 11:19 AM
03-01-2016 11:24 AM
Thanks, but what if I do not want the spaces between the final string..?
03-01-2016 11:32 AM
You could index thru the array using a FOR LOOP and concatenate all of the values together into one string using shift registers. If you are unfamiliar with these terms, I would suggest going thru tutorial videos to learn the basics of Labview.
03-01-2016 11:36 AM - edited 03-01-2016 11:42 AM
The default delimiter when working with Array to Spreadsheet String is Tab. You can't put an empty string, but you can replace all of the Tab values if you really want:
You marked Kyle's answer as the solution, but keep in mind that that will only work if you have a single string character.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
03-01-2016 12:44 PM
Just to un-rube your code a lot James.
"I won't be wronged. I won't be insulted. I won't be laid a-hand on. I don't do these things to other people, and I require the same from them." John Bernard Books