mzucker
(Martin Zucker)
June 18, 2019, 5:01am
1
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
Vashisht
(Vashisht Devasani)
June 18, 2019, 5:06am
2
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:
mcicca
(Marco)
June 18, 2019, 5:06am
3
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
mzucker
(Martin Zucker)
June 18, 2019, 5:26am
5
If they are not strings do I simply do variable.ToString?
1 Like
mzucker
(Martin Zucker)
June 18, 2019, 5:28am
6
Thanks @KarthikByggari , I wasn’t using spaces before
mcicca
(Marco)
June 18, 2019, 5:29am
7
@mzucker correct, provided the variable type it is beforehand is able to convert to string (most should be).
mzucker
(Martin Zucker)
June 18, 2019, 5:32am
8
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!”