somya177
(somya)
February 11, 2019, 5:10pm
1
i have a string containing address and i want to pick only state/province from it which will always be two alphabets.please suggest.
Example:
house no.1,Abc street
Berlin,ON, L65X1W
I have to pick only ‘ON’ from this whole address string.
Please suggest
1 Like
arivu96
(Arivazhagan A)
February 11, 2019, 5:28pm
2
Hi @somya177
You can use the below methods
regex
substring
3 split method you can check each value
Regards,
Arivu
1 Like
arivu96
(Arivazhagan A)
February 11, 2019, 5:42pm
4
Use regex pattern [A-Z]{2}
Regards,
Arivu
1 Like
somya177
(somya)
February 11, 2019, 6:49pm
5
how we will display the result of it?
Like i just want ON from the whole string to be displayed.
1 Like
c.ciprian
(Ciprian Constantinescu)
February 11, 2019, 7:04pm
6
somya177:
Example:
house no.1,Abc street
Berlin,ON, L65X1W
I have to pick only ‘ON’ from this whole address string.
Please suggest
Split the string on new line, then on comma character and get the second element
1 Like
somya177
(somya)
February 11, 2019, 7:18pm
7
can u please share the workflow sample?
somya177
(somya)
February 11, 2019, 7:54pm
9
Hi,
I am getting below error
Assign: Index was outside the bounds of the array.
somya177
(somya)
February 11, 2019, 7:58pm
10
Hi,
I am getting below error.:
Source: Assign
Message: Index was outside the bounds of the array.
Exception Type: System.IndexOutOfRangeException
c.ciprian
(Ciprian Constantinescu)
February 11, 2019, 8:01pm
11
No error here… Did you run my sample or it gives an error after adapting in your flow?
1 Like
somya177
(somya)
February 11, 2019, 8:42pm
12
in my flow,there is space and not comma.
so i replaced comma with space IN SPLIT function in order to make my workflow work.
it is: BERLIN ON L65X1W
somya177
(somya)
February 11, 2019, 9:10pm
14
no…its giving the previous error
c.ciprian
(Ciprian Constantinescu)
February 11, 2019, 9:21pm
15
Then post the exact input file/text here…
somya177
(somya)
February 11, 2019, 9:39pm
16
this is the exact input;
1-7200 KENILWORTHROAD RD
BRAMPTON ON L6T0C1
i just want to extract ON from this.
c.ciprian
(Ciprian Constantinescu)
February 11, 2019, 9:45pm
17
Should work as I have written it, replacing comma with space. The difference might be the newline character. I think the error is on the first split. Check there.
somya177
(somya)
February 11, 2019, 9:47pm
18
should i should not do first step?
somya177
(somya)
February 11, 2019, 9:47pm
19
first split should be done on new line?
somya177
(somya)
February 11, 2019, 9:49pm
20
is there any way to use it using substring?