09-27-2021 04:40 PM
Hello,
I am attempting to place a string into an array. However, the length of the strings should be 4.
If my input is ABCD0122FFEA the output array should be
ABCD
0122
FFEA
Thanks!
09-27-2021 04:50 PM - edited 09-27-2021 04:54 PM
@hiNI wrote:
Hello,
I am attempting to place a string into an array. However, the length of the strings should be 4.
If my input is ABCD0122FFEA the output array should be
ABCD
0122
FFEA
Thanks!
Your code is more complicated than it needs to be (besides not working correctly). Think about your requirement. Isn't this really about ripping the first four characters out of your string, placing it into an element, then repeating this until you have no more characters left?
HINT: Look in Additonal String Functions to see if you can find anything useful there.
Note:
If this was a message that needed to be decoded as three chunks of data, I might approach this differently.
09-28-2021 07:47 AM - edited 09-28-2021 07:48 AM
You were actually pretty close. I removed the initial String Subset that was outside of the loop and then got rid of the Shift Register. A little more cleaning up and this was my result.
09-28-2021 07:52 AM
(can be simplified depending on how much is known about the input, see above)