Concatenating strings and variables

Hello I would like to concatenate several variables and strings.
For example would this be the correct way
Input: “Dear” + customer + “I am writing to inform you of” + problem +“Thanks!”
Output: Dear John Blake, I am writing to inform you of tire puncture. Thanks!

Let me know if this needs any clarification.
Thank you

1 Like

Hi,You want to know is that correct way or not?
Yes, it is the correct way of using until the customer and problem variables are strings.This is the dynamic way.
If you find this useful mark it as solution.
Cheers:smiley:

Hi @mzucker,

Yes that should be correct, provided that both of the variables are strings!

You must use assign activity, to make the variables work.

You must include spaces for the required output like below.

Input = “Dear ” + customer + “, I am writing to inform you of ” + problem + “. Thanks!”

And the way you used variables are correct.

Regards,
Karthik Byggari

7 Likes

If they are not strings do I simply do variable.ToString?

1 Like

Thanks @KarthikByggari, I wasn’t using spaces before

@mzucker correct, provided the variable type it is beforehand is able to convert to string (most should be).

Kind of a second question, how do I then input a change in paragraph.
Output:

Dear John Blake,
I am writing to inform you of tire puncture.
Thanks!

Input = “Dear ” + customer + “,” + Environment.NewLine + “I am writing to inform you of ” + problem + “.” + Environment.NewLine + “Thanks!”

You can use Environment.NewLine to insert a line break.

2 Likes

hi if i want bring + symbol between two strings as out put how i can do this

Hi @Ekanadam_Pathuri

You can use this below format to bring + in between Strings.

You can pass + as string in between two strings and concat using + symbol.

"Dear " + “+” + "Customer "

Thanks

"Dear "+customer.ToString+“ , I am writing to inform you of ”+problem.ToString+“. Thanks!”