RPA3
(RPA3)
December 16, 2019, 10:48am
1
Hello everyone!
I have message:
qwerty,
asdf,
zxcv,
cvbnm
I need take “qwerty”, “asdf”, “zxcv”, “cvbnm” and write it one by one in different variables.
I did Assign:
first = mail.Body.Split(“,”.ToCharArray)(0)
How to tale all of them in different variables and save?
lakshman
(Ganta lakshman)
December 16, 2019, 11:16am
2
@RPA3
Split it based on comma as delimiter as you mentioned in above post.
arrMail [] = mail.Body.Split(",".ToCharArray)
Then use ForEach loop to iterate one by one item from that array and pass it to different variables.
RPA3
(RPA3)
December 16, 2019, 11:55am
3
What do if body of message:
qwerty,
asdf,
zxcv,
cvbnm
From…
From don’t need, but last element now:
cvbnm
From…
lakshman
(Ganta lakshman)
December 16, 2019, 12:08pm
4
@RPA3
Then you have to split it based on New Line.
arrMail [] = mail.Body.Split(Environment.NewLine.ToCharArray)
@RPA3
@RPA3
Split it based on comma as delimiter as you mentioned in above post.
arrMail [] = mail.Body.Split(",".ToCharArray)
Then use ForEach loop to iterate one by one item from that array and pass it to different variables.
Following this , You can use body.contains()
For Each / Followed by if condition to overcome this.
Regards,
Srenivasan Kanna
RPA3
(RPA3)
December 16, 2019, 12:49pm
7
How save all element?
Assign don’t work
RPA3
(RPA3)
December 16, 2019, 1:54pm
8
What about you? I don’t understand.
RPA3
(RPA3)
December 17, 2019, 9:13am
9
Could you help me, please?
lakshman
(Ganta lakshman)
December 17, 2019, 9:16am
10
@RPA3
What you want to do after assigning each value to variable ?
If suppose 100 values are then do you want to create 100 variables ?