The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Building strings with loops and Concatenate Strings

SercoSteveB
Active Participant

What are the values of String Out and String Length Out following execution of the VI?

 Daily CLAD #22 Build Strings #2.png

 

 

a)      <empty string>, 0

b)      “Steve Likes”, 11

c)       “Steve Likes LabVIEW”, 19

d)      “Steve Likes LabVIEW “,20

 

NOTE:  The inverted commas ("") are to highlight white space they do not appear in String Out

 

 

 

Comments
ashwinilele
Member

its D

RustyStrings
Member

The answer is D

The string length is the 17 original characters from the 3 strings in the array with the additional 3 spaces added during the loop

Quite often after section of code like this is executed you would then use a string subset to remove the last space (subtract 1 from the lenght for the input of the subset function)

SercoSteveB
Active Participant

Answer: D.  Nice one RS and ash.  Yep; key points are:

     The loop iteration count is controlled by the auto-indexed array size (I should have shown an empty element at the bottom of the array constant to define how big the array is.  A note for next time.)

     The string is maintained in the shift register between iterations.  The initial value of the shift register is <empty string>

     The <space> constant is added to the end of the string stored in the shift register for each of the three iterations of the loop.

ersmt444
Member

Image broken

skian
Member

D