balkishan
(Balkishan Singh)
September 11, 2019, 11:25am
1
Hi, I want always the last three-digit after semicolon.
As my input come like
102-311: Apple
192-321: peas
712: Samsung
817: nokia
Expected I want to exxract alwasy last 3 digit before : (semicolon)
I want to extract like 311, 321, 712 and 817 only this.
@Palaniyappan @HareeshMR
1 Like
Palaniyappan
(Palaniyappan P )
September 11, 2019, 11:28am
2
Fine use this expression in the assign activity like this
if
input is
str_input = β102-311: Appleβ
then
str_output = System.Text.RegularExpressions.Regex.Match(str_input,β\d*:β).tosting.Replace(β:β,ββ)
it worked as well (we are replacing : with Replace method)
Cheers @balkishan
1 Like
J0ska
September 11, 2019, 11:29am
3
Use regular expression - regex.
Go to https://regex101.com/ to learn how to make such regex.
Cheers
balkishan
(Balkishan Singh)
September 11, 2019, 11:39am
4
I have to eleminate : also.
I need only last three digit bro
balkishan
(Balkishan Singh)
September 11, 2019, 12:06pm
7
J0ska:
\d{3}(?=:)
can you tell me what it this error.
@Palaniyappan
1 Like
J0ska
September 11, 2019, 12:14pm
8
Correct name of the namespace is
System.Text.RegularExpressions
Why donβt you check using IntelliSense?
Cheers
Palaniyappan
(Palaniyappan P )
September 11, 2019, 12:15pm
9
you were almost done buddy
System.Text.RegularExpressions .Regex.Match(str_input,β\d*:β).tosting.Replace(β:β,ββ)
typo mistake
Cheers @balkishan
1 Like
amaresan
(Amaran)
September 11, 2019, 12:20pm
10
@balkishan
Use below code in assign activity or message box
System.Text.RegularExpressions.Regex.Match(str_input,β\d{3}(?=:)β).tostring
2 Likes
system
(system)
Closed
September 14, 2019, 12:20pm
11
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.