Storing multiple values in a string


I having a string variable name as “str”, am using it under for loop. So, during each loop “str” variable will be getting a value, I want to save all string data in the same or in single string variable with space separated. Then I will be passing the variable value into my first column of datatable. How can i do that?

@monish06 You can use an Assign like this :
str = str+" "

This Should Work, Try it out :sweat_smile:



Step 1: Initialize “str” variable outside for loop
Step 2: str = str + " " + newValueToAppend
Step 3: Outside for loop assign value of str to datatable



1)We can use StringBuilder for this
2)Using Assign and append the value in loop

Initially String1,String2 will be blank

inside loop
string1 = string1 +" "+string2

end of loop


clear it if required .


Inside loop first check whether the index is 0 or not
If index is 0 assign Str = Variable.
Else assign Str = Str+" "+Variable.
At last Str will have all the variable value with space separated.

Then to add str variable to first column of datable use assign activity
Datatable.rows(RowNumber)(0) = Str