# Expression clarification

**URL:** <https://forum.uipath.com/t/expression-clarification/518886>\
**Category:** Studio\
**Tags:** variables-management, question, studio\
**Created:** [February 20, 2023, 10:54am UTC](https://forum.uipath.com/t/expression-clarification/518886 "2023-02-20T10:54:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![NayabImran](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nayabimran/32/330007_2.png) [@NayabImran](https://forum.uipath.com/u/NayabImran)\
**Post date:** [February 20, 2023, 10:54am UTC](https://forum.uipath.com/t/expression-clarification/518886/1 "2023-02-20T10:54:13Z")

</div>

Hello All,

Could anyone please explain or clarify for me? How the expressions below are derived and used. I mean need to know why we are using in the below image “new” to declare another string array.

 ![image](https://global.discourse-cdn.com/uipath/original/4X/8/c/2/8c2f00f5c0ed5f31e41cba78c65f5e18c266d642.png)

And, why we are using string. Join (" ", AX) to display in output panel not as AX only.

---

<div class="post-metadata">

**Author:** ![Anil\_G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anil_g/32/524291_2.png) [@Anil\_G](https://forum.uipath.com/u/Anil_G)\
**Post date:** [February 20, 2023, 11:13am UTC](https://forum.uipath.com/t/expression-clarification/518886/2 "2023-02-20T11:13:53Z")

</div>

@NayabImran

That is to initialize string array with no values.

and in logs you can use ax as well but display will be different…to have display with space separation it is used as above

cheers

---

<div class="post-metadata">

**Author:** ![Sudharsan\_Ka](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sudharsan_ka/32/459826_2.png) [@Sudharsan\_Ka](https://forum.uipath.com/u/Sudharsan_Ka)\
**Post date:** [February 20, 2023, 11:15am UTC](https://forum.uipath.com/t/expression-clarification/518886/3 "2023-02-20T11:15:08Z")

</div>

HI @NayabImran

We are using the New String() {} to initialize the string of array variable that is like telling and confirming the variable will be string of array

And String of Array will not print all of its data in a single line if we use only AX in the log message

SO we needed the expression  
String.Join(“Seperator as string”,ArrayOdString)

What it will do is it will combine all the array values into single string with the separator you given

> [@NayabImran](#):
>
> string. Join (" ", AX)

in this your array will be separated with space like

```auto
A B C D

```

Regards  
Sudharsan

---

<div class="post-metadata">

**Author:** ![ppr](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ppr/32/464097_2.png) [@ppr](https://forum.uipath.com/u/ppr)\
**Post date:** [February 20, 2023, 11:18am UTC](https://forum.uipath.com/t/expression-clarification/518886/4 "2023-02-20T11:18:47Z")

</div>

> [@NayabImran](#):
>
> why we are using string. Join (" ", AX) to display in output panel not as AX only.

we use the string.Join statement to flatten down the string array to a string. Otherwise we would not see the content fro array when using toString()

![grafik](https://global.discourse-cdn.com/uipath/original/4X/5/6/c/56cbd6109b98d645371bc0648465cc7cc11eba1b.png)

> [@NayabImran](#):
>
> I mean need to know why we are using in the below image “new” to declare another string array.

we initialize the String Array with the new statement and assign an empty string array for it

> **[How to: Initialize an Array Variable - Visual Basic](https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/arrays/how-to-initialize-an-array-variable)**
>
> Learn more about: How to: Initialize an Array Variable in Visual Basic

---

<div class="post-metadata">

**Author:** ![supermanPunch](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/supermanpunch/32/133652_2.png) [@supermanPunch](https://forum.uipath.com/u/supermanPunch)\
**Post date:** [February 20, 2023, 11:47am UTC](https://forum.uipath.com/t/expression-clarification/518886/5 "2023-02-20T11:47:40Z")

</div>

> [@NayabImran](#):
>
> I mean need to know why we are using in the below image “new”

Hi @NayabImran ,

An addition to all the above posts, We can test and check what happens when we use an Array String variable directly without initialisation and when used with the Initialisation.

Below are two variables used to demonstrate the differences and also the reasons as to why we would have to initialise the arrays :

 ![image](https://global.discourse-cdn.com/uipath/original/4X/0/9/9/09985e552fe722f7e38b3b733d462c180d32239e.png)

From the Debugging Panel :  
 ![image](https://global.discourse-cdn.com/uipath/original/4X/7/b/5/7b5480d6d24cae070527e0ecb4ad386f239b6f22.png)

You could notice that the variable which is not initialised provides us with null value, which in turn provides us with errors when checked with array methods such as `Count`, `Append`, `Concat` etc.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [February 23, 2023, 11:48am UTC](https://forum.uipath.com/t/expression-clarification/518886/6 "2023-02-23T11:48:20Z")

</div>

Closed on February 23, 2023, 11:48am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
